Skip to content

Commit ceb5414

Browse files
herndlmondrejmirtes
authored andcommitted
Re-use inArray resolver for oneOf since it's an alias
1 parent d23102b commit ceb5414

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,7 @@ static function (?ArrayItem $class) use ($scope, $expr) {
679679
);
680680
},
681681
'oneOf' => static function (Scope $scope, Arg $needle, Arg $array): Expr {
682-
return new FuncCall(
683-
new Name('in_array'),
684-
[
685-
$needle,
686-
$array,
687-
new Arg(new ConstFetch(new Name('true'))),
688-
]
689-
);
682+
return self::$resolvers['inArray']($scope, $needle, $array);
690683
},
691684
'methodExists' => static function (Scope $scope, Arg $object, Arg $method): Expr {
692685
return new FuncCall(

0 commit comments

Comments
 (0)