Skip to content

Commit e64710d

Browse files
Try
1 parent 7eccdaf commit e64710d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Rules/Classes/NewStaticRule.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use PHPStan\Reflection\Php\PhpMethodReflection;
1010
use PHPStan\Rules\Rule;
1111
use PHPStan\Rules\RuleErrorBuilder;
12+
use PHPStan\TrinaryLogic;
13+
1214
use function strtolower;
1315

1416
/**
@@ -90,9 +92,8 @@ public function processNode(Node $node, Scope $scope): array
9092
) {
9193
$traitReflection = $scope->getTraitReflection();
9294
if ($traitReflection->hasConstructor()) {
93-
$traitConstructor = $traitReflection->getConstructor();
94-
95-
if ($traitConstructor instanceof PhpMethodReflection && $traitConstructor->isAbstract()) {
95+
$isAbstract = $traitReflection->getConstructor()->isAbstract();
96+
if ($isAbstract === true || ($isAbstract instanceof TrinaryLogic && $isAbstract->yes())) {
9697
return [];
9798
}
9899
}

0 commit comments

Comments
 (0)