Skip to content

Commit 39a6edd

Browse files
committed
allow abstract non-final hooks
1 parent d95074f commit 39a6edd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Rules/Properties/PropertyInClassRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ public function processNode(Node $node, Scope $scope): array
128128
}
129129

130130
foreach ($node->getHooks() as $hook) {
131+
if ($hook->body !== null) {
132+
continue;
133+
}
134+
131135
if (!$hook->isFinal()) {
132136
continue;
133137
}

tests/PHPStan/Rules/Properties/data/abstract-final-property-hook.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ abstract class User
88
final get;
99
}
1010
}
11+
12+
abstract class Foo
13+
{
14+
abstract public int $i { final get { return 1;} set; }
15+
}

0 commit comments

Comments
 (0)