Skip to content

Commit

Permalink
Check for UnitEnum instead of BackedEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkleemans committed Aug 31, 2022
1 parent 86ae1d9 commit 93dbff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AttributeEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private function fireAttributeEvents(): void

if (
$expected === '*'
|| $value instanceof \BackedEnum && ($value->name === $expected)
|| $value instanceof \UnitEnum && ($value->name === $expected)
|| $expected === 'true' && $value === true
|| $expected === 'false' && $value === false
|| is_numeric($expected) && Str::contains($expected, '.') && $value === (float) $expected // float
Expand Down

0 comments on commit 93dbff5

Please sign in to comment.