Skip to content

Commit

Permalink
Re-use inArray resolver for oneOf since it's an alias
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm authored and ondrejmirtes committed Feb 27, 2022
1 parent d23102b commit ceb5414
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,7 @@ static function (?ArrayItem $class) use ($scope, $expr) {
);
},
'oneOf' => static function (Scope $scope, Arg $needle, Arg $array): Expr {
return new FuncCall(
new Name('in_array'),
[
$needle,
$array,
new Arg(new ConstFetch(new Name('true'))),
]
);
return self::$resolvers['inArray']($scope, $needle, $array);
},
'methodExists' => static function (Scope $scope, Arg $object, Arg $method): Expr {
return new FuncCall(
Expand Down

0 comments on commit ceb5414

Please sign in to comment.