Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Commit db2c503

Browse files
authored
Checking types are instance of ReflectionNamedType
1 parent fe8bf7f commit db2c503

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Method.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public static function match(\ReflectionMethod $method): bool
6666
}
6767
$ctxType = $method->getParameters()[0]->getType();
6868
$inType = $method->getParameters()[1]->getType();
69-
$ctx = $ctxType && ! $ctxType->isBuiltin() ? new \ReflectionClass($ctxType->getName()) : null;
70-
$in = $inType && ! $inType->isBuiltin() ? new \ReflectionClass($inType->getName()) : null;
69+
$ctx = $ctxType && $ctxType instanceof \ReflectionNamedType && !$ctxType->isBuiltin() ? new \ReflectionClass($ctxType->getName()) : null;
70+
$in = $inType && $inType instanceof \ReflectionNamedType && ! $inType->isBuiltin() ? new \ReflectionClass($inType->getName()) : null;
7171

7272
if (empty($ctx) || !$ctx->implementsInterface(ContextInterface::class)) {
7373
return false;

0 commit comments

Comments
 (0)