We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 845455d + 5ae9929 commit 99f9a97Copy full SHA for 99f9a97
1 file changed
src/Traits/EnumFrom.php
@@ -20,9 +20,8 @@ public static function wrap(self|string|int|null $value): ?self
20
}
21
22
if (is_string($value) && self::isIntBacked()) {
23
- $tmpValue = intval($value);
24
- if (! empty($tmpValue)) {
25
- $enum = self::tryFrom($tmpValue);
+ if (is_numeric($value)) {
+ $enum = self::tryFrom(intval($value));
26
27
} else {
28
$enum = self::tryFrom($value);
0 commit comments