From 321b3e8df370c734b60d61f42581ae9deecc947a Mon Sep 17 00:00:00 2001 From: Tom Witkowski Date: Sun, 21 Jun 2020 18:31:09 +0200 Subject: [PATCH] use call_user_func_array instead of direct calling __call add check for __callStatic --- src/Support/Reflection.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Support/Reflection.php b/src/Support/Reflection.php index 44805ba2..79342e74 100644 --- a/src/Support/Reflection.php +++ b/src/Support/Reflection.php @@ -34,8 +34,11 @@ final class Reflection return $reflectionMethod->invoke($object, ...$args); } catch (ReflectionException $exception) { - if (method_exists($object, '__call')) { - return $object->__call($method, $args); + if ( + method_exists($object, '__call') + || method_exists($object, '__callStatic') + ) { + return call_user_func_array([$object, $method], $args); } throw $exception;