mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
use call_user_func_array instead of direct calling __call
add check for __callStatic
This commit is contained in:
@ -34,8 +34,11 @@ final class Reflection
|
|||||||
|
|
||||||
return $reflectionMethod->invoke($object, ...$args);
|
return $reflectionMethod->invoke($object, ...$args);
|
||||||
} catch (ReflectionException $exception) {
|
} catch (ReflectionException $exception) {
|
||||||
if (method_exists($object, '__call')) {
|
if (
|
||||||
return $object->__call($method, $args);
|
method_exists($object, '__call')
|
||||||
|
|| method_exists($object, '__callStatic')
|
||||||
|
) {
|
||||||
|
return call_user_func_array([$object, $method], $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
|||||||
Reference in New Issue
Block a user