From 2ca1cf812d236f23a11883626db9344db12cab3b Mon Sep 17 00:00:00 2001 From: Bryan Mulingbayan Date: Tue, 7 Jan 2025 15:55:08 +0800 Subject: [PATCH] Fix: ErrorException Only variables should be passed by reference --- lib/ObjectSerializer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 160619f..54a1548 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -495,7 +495,8 @@ public static function deserialize($data, $class, $httpHeaders = null) if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { - $data = end($class::getAllowableEnumValues()); + $allowableEnumValues = $class::getAllowableEnumValues(); + $data = end($allowableEnumValues); } return $data; } else {