Skip to content

Commit 1358bc2

Browse files
committed
fix(php): fix typo
1 parent 25b5509 commit 1358bc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

templates/php/ObjectSerializer.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,22 @@ class ObjectSerializer
5656
$values = [];
5757
if ($data instanceof ModelInterface) {
5858
$formats = $data::modelFormats();
59-
foreach ($data::openAPITypes() as $property => $openAPIType) {
59+
foreach ($data::modelTypes() as $property => $modelTypes) {
6060
$getter = $data::getters()[$property];
6161
$value = $data->$getter();
62-
if ($value !== null && !in_array(modelTypes, [{{{primitives}}}], true)) {
63-
$callable = [modelTypes, 'getAllowableEnumValues'];
62+
if ($value !== null && !in_array($modelTypes, [{{{primitives}}}], true)) {
63+
$callable = [$modelTypes, 'getAllowableEnumValues'];
6464
if (is_callable($callable)) {
6565
/** array $callable */
6666
$allowedEnumTypes = $callable();
6767
if (!in_array($value, $allowedEnumTypes, true)) {
6868
$imploded = implode("', '", $allowedEnumTypes);
69-
throw new \InvalidArgumentException("Invalid value for enum 'openAPITypes', must be one of: '$imploded'");
69+
throw new \InvalidArgumentException("Invalid value for enum '$modelTypes', must be one of: '$imploded'");
7070
}
7171
}
7272
}
7373
if ($value !== null) {
74-
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, openAPITypes, $formats[$property]);
74+
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $modelTypes, $formats[$property]);
7575
}
7676
}
7777
} else {

0 commit comments

Comments
 (0)