Skip to content

Commit

Permalink
qa: fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
romm committed Jan 6, 2022
1 parent 85a6a49 commit 9537d0a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Mapper/Tree/Builder/EnumNodeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private function valueMatchesEnumCase($value, UnitEnum $case): bool
return $value === $case->name;
}

// @phpstan-ignore-next-line // wait for PHPStan support for PHP 8.1
if (is_string($case->value)) {
if (! is_string($value) && ! is_numeric($value) && ! $value instanceof Stringable) {
return false;
Expand All @@ -57,11 +56,10 @@ private function valueMatchesEnumCase($value, UnitEnum $case): bool
return (string)$value === $case->value;
}

// @phpstan-ignore-next-line // wait for PHPStan support for PHP 8.1
if (is_bool($value) || filter_var($value, FILTER_VALIDATE_INT) === false) {
return false;
}

return (int)$value === $case->value;
return (int)$value === $case->value; // @phpstan-ignore-line
}
}

0 comments on commit 9537d0a

Please sign in to comment.