File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,12 +324,8 @@ function fatalError($error)
324324/**
325325 * @internal
326326 */
327- function _checkTypehint (callable $ callback , $ object )
327+ function _checkTypehint (callable $ callback , \ Throwable $ reason )
328328{
329- if (!\is_object ($ object )) {
330- return true ;
331- }
332-
333329 if (\is_array ($ callback )) {
334330 $ callbackReflection = new \ReflectionMethod ($ callback [0 ], $ callback [1 ]);
335331 } elseif (\is_object ($ callback ) && !$ callback instanceof \Closure) {
@@ -344,11 +340,11 @@ function _checkTypehint(callable $callback, $object)
344340 return true ;
345341 }
346342
347- $ expectedException = $ parameters [0 ];
343+ $ expectedClass = $ parameters [0 ]-> getClass () ;
348344
349- if (!$ expectedException -> getClass () ) {
345+ if (!$ expectedClass ) {
350346 return true ;
351347 }
352348
353- return $ expectedException -> getClass ()-> isInstance ($ object );
349+ return $ expectedClass -> isInstance ($ reason );
354350}
You can’t perform that action at this time.
0 commit comments