From 0ea419eb6e123698ed7bcee471369a96c1f63d51 Mon Sep 17 00:00:00 2001 From: "Ralph J. Smit" <59207045+ralphjsmit@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:11:02 +0100 Subject: [PATCH] Style --- .../Database/Eloquent/Concerns/HasAttributes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index e31464007595..7a9f8822d2f9 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -1188,7 +1188,7 @@ protected function setEnumCastableAttribute($key, $value) $this->attributes[$key] = $this->getStorableEnumValue($value); } else { $this->attributes[$key] = $this->getStorableEnumValue( - $this->getEnumCaseFromValue($enumClass, $value) + $this->getEnumCaseFromValue($enumClass, $value) ); } } @@ -1238,8 +1238,8 @@ protected function getEnumCaseFromValue($enumClass, $value) protected function getStorableEnumValue($value) { return $value instanceof BackedEnum - ? $value->value - : $value->name; + ? $value->value + : $value->name; } /** @@ -1251,7 +1251,7 @@ protected function getStorableEnumValue($value) protected function getStorableEnumArrayValue($value) { return json_encode( - array_map(fn ($value) => $this->getStorableEnumValue($value), $value) + array_map(fn ($value) => $this->getStorableEnumValue($value), $value) ); }