File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1111use ReflectionMethod ;
1212use ReflectionNamedType ;
1313use ReflectionUnionType ;
14+ use Webmozart \Assert \Assert ;
1415
1516use function array_map ;
1617use function gettype ;
@@ -36,8 +37,10 @@ public static function boolean(callable $filter): void
3637
3738 if ($ returnType instanceof ReflectionUnionType || $ returnType instanceof ReflectionIntersectionType) {
3839 $ separator = $ returnType instanceof ReflectionUnionType ? '| ' : '& ' ;
39- /** @var ReflectionNamedType[] $types */
40- $ types = $ returnType ->getTypes ();
40+ $ types = $ returnType ->getTypes ();
41+
42+ Assert::allIsInstanceOf ($ types , ReflectionNamedType::class);
43+
4144 throw new InvalidArgumentException (
4245 sprintf (
4346 'Expected a bool return type on callable filter, %s given ' ,
You can’t perform that action at this time.
0 commit comments