Skip to content

Commit 2a9d836

Browse files
stubboGromNaN
andauthored
Cleanup casting in Model::setAttribute
Co-authored-by: Jérôme Tamarelle <[email protected]>
1 parent 9acd088 commit 2a9d836

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Eloquent/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ public function setAttribute($key, $value)
243243
$castOptions = Str::after($casts[$key], ':');
244244

245245
// Can add more native mongo type casts here.
246-
$value = match (true) {
247-
$castType === 'decimal' => $this->fromDecimal($value, $castOptions),
248-
default => $value,
246+
$value = match ($castType) {
247+
'decimal' => $this->fromDecimal($value, $castOptions),
248+
default => $value,
249249
};
250250
}
251251

0 commit comments

Comments
 (0)