Skip to content

Commit 34d0c27

Browse files
Try
1 parent 80c1109 commit 34d0c27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rules/Classes/NewStaticRule.php

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

1415
/**
@@ -90,9 +91,8 @@ public function processNode(Node $node, Scope $scope): array
9091
) {
9192
$traitReflection = $scope->getTraitReflection();
9293
if ($traitReflection->hasConstructor()) {
93-
$traitConstructor = $traitReflection->getConstructor();
94-
95-
if ($traitConstructor instanceof PhpMethodReflection && $traitConstructor->isAbstract()) {
94+
$isAbstract = $traitReflection->getConstructor()->isAbstract();
95+
if ($isAbstract === true || ($isAbstract instanceof TrinaryLogic && $isAbstract->yes())) {
9696
return [];
9797
}
9898
}

0 commit comments

Comments
 (0)