From 11b42c87ee0dc1ccf6d6d06ec439dfd0816f91af Mon Sep 17 00:00:00 2001 From: Adam Kadlec Date: Tue, 25 Oct 2022 14:05:03 +0200 Subject: [PATCH] Fixing class check --- src/Helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helpers.php b/src/Helpers.php index 43fca11..0bc7505 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -73,7 +73,7 @@ public static function autowireArguments(ReflectionMethod $method, array $argume if ($class !== null && (class_exists($class) || interface_exists($class))) { foreach ($arguments as $key => $argument) { /** @phpstan-ignore-next-line */ - if (is_object($argument) && is_subclass_of($argument, $class)) { + if (is_object($argument) && (is_subclass_of($argument, $class) || get_class($argument) === $class)) { $res[$subNum] = $argument; unset($arguments[$key]); $optCount = 0;