Skip to content

Commit 0533fa2

Browse files
committed
Use isSuperTypeOf
1 parent 58901c1 commit 0533fa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Rule/Nette/RegularExpressionPatternRule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use PHPStan\Analyser\Scope;
1010
use PHPStan\Rules\Rule;
1111
use PHPStan\Rules\RuleErrorBuilder;
12+
use PHPStan\Type\ObjectType;
1213
use function in_array;
1314
use function sprintf;
1415
use function strtolower;
@@ -52,7 +53,7 @@ private function extractPatterns(StaticCall $staticCall, Scope $scope): array
5253
return [];
5354
}
5455
$caller = $scope->resolveTypeByName($staticCall->class);
55-
if ($caller->getClassReflection() === null || !$caller->getClassReflection()->is(Strings::class)) {
56+
if (!(new ObjectType(Strings::class))->isSuperTypeOf($caller)->yes()) {
5657
return [];
5758
}
5859
$methodName = strtolower((string) $staticCall->name);

0 commit comments

Comments
 (0)