Skip to content

Commit fdda36e

Browse files
committed
Move code
1 parent ca26ca4 commit fdda36e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/Rules/Properties/PropertyInClassRule.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ public function processNode(Node $node, Scope $scope): array
7272
->build(),
7373
];
7474
}
75+
} elseif (!$this->doAllHooksHaveBody($node)) {
76+
return [
77+
RuleErrorBuilder::message('Non-abstract properties cannot include hooks without bodies.')
78+
->nonIgnorable()
79+
->identifier('property.hookWithoutBody')
80+
->build(),
81+
];
7582
}
7683

7784
if ($node->isReadOnly()) {
@@ -85,17 +92,6 @@ public function processNode(Node $node, Scope $scope): array
8592
}
8693
}
8794

88-
if (!$node->isAbstract() && !$node->isReadOnly()) {
89-
if (!$this->doAllHooksHaveBody($node)) {
90-
return [
91-
RuleErrorBuilder::message('Non-abstract properties cannot include hooks without bodies.')
92-
->nonIgnorable()
93-
->identifier('property.hookWithoutBody')
94-
->build(),
95-
];
96-
}
97-
}
98-
9995
return [];
10096
}
10197

0 commit comments

Comments
 (0)