File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1414 },
1515 "require-dev" : {
1616 "phpunit/phpunit" : " ^9.0 || ^10.0 || ^11.0" ,
17- "phpstan/phpstan" : " ~1.10.3 " ,
17+ "phpstan/phpstan" : " 2.1.0 " ,
1818 "phpstan/extension-installer" : " ^1.0" ,
19- "phpstan/phpstan-strict-rules" : " ^1 .0"
19+ "phpstan/phpstan-strict-rules" : " ^2 .0"
2020 },
2121 "replace" : {
2222 "daverandom/callback-validator" : " *"
Original file line number Diff line number Diff line change 22
33namespace DaveRandom \CallbackValidator ;
44
5+ use function is_object ;
6+ use function is_string ;
7+
58final class CallbackType
69{
710 /**
@@ -30,7 +33,12 @@ private static function reflectCallable($target)
3033 return new \ReflectionFunction ($ target );
3134 }
3235
33- if (\is_array ($ target ) && isset ($ target [0 ], $ target [1 ])) {
36+ if (
37+ \is_array ($ target ) &&
38+ isset ($ target [0 ], $ target [1 ]) &&
39+ (is_object ($ target [0 ]) || is_string ($ target [0 ])) &&
40+ is_string ($ target [1 ])
41+ ) {
3442 return new \ReflectionMethod ($ target [0 ], $ target [1 ]);
3543 }
3644
You can’t perform that action at this time.
0 commit comments