diff --git a/src/MessageBus/CommandBusDynamicMethodThrowTypeExtension.php b/src/MessageBus/CommandBusDynamicMethodThrowTypeExtension.php index 2af4d56..b1e3f90 100644 --- a/src/MessageBus/CommandBusDynamicMethodThrowTypeExtension.php +++ b/src/MessageBus/CommandBusDynamicMethodThrowTypeExtension.php @@ -31,7 +31,7 @@ public function __construct(CommandTypeExtractor $commandTypeExtractor, CommandH public function isMethodSupported(MethodReflection $methodReflection): bool { - if (! is_a($methodReflection->getDeclaringClass()->getName(), CommandBus::class, true)) { + if (! $methodReflection->getDeclaringClass()->is(CommandBus::class)) { return false; }