Skip to content

Commit 6ccdba2

Browse files
committed
PropertyInClassRule - move supportsPropertyHooks check to bottom to have more errors reported
1 parent 8b2b97f commit 6ccdba2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/Rules/Properties/PropertyInClassRule.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ public function processNode(Node $node, Scope $scope): array
4646
];
4747
}
4848

49-
if (!$this->phpVersion->supportsPropertyHooks()) {
50-
if ($node->hasHooks()) {
51-
return [
52-
RuleErrorBuilder::message('Property hooks are supported only on PHP 8.4 and later.')
53-
->nonIgnorable()
54-
->identifier('property.hooksNotSupported')
55-
->build(),
56-
];
57-
}
58-
59-
return [];
60-
}
61-
6249
if ($node->isAbstract()) {
6350
if (!$node->hasHooks()) {
6451
return [
@@ -204,6 +191,19 @@ public function processNode(Node $node, Scope $scope): array
204191
}
205192
}
206193

194+
if (!$this->phpVersion->supportsPropertyHooks()) {
195+
if ($node->hasHooks()) {
196+
return [
197+
RuleErrorBuilder::message('Property hooks are supported only on PHP 8.4 and later.')
198+
->nonIgnorable()
199+
->identifier('property.hooksNotSupported')
200+
->build(),
201+
];
202+
}
203+
204+
return [];
205+
}
206+
207207
return [];
208208
}
209209

0 commit comments

Comments
 (0)