Skip to content

Commit b8566d3

Browse files
phpstan-botclaude
andcommitted
Uncomment expected premature access errors in readonly property test
Now that uninitialized properties are correctly tracked in methods called from constructors, premature access to readonly properties in those methods is properly detected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9660125 commit b8566d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/PHPStan/Rules/Properties/MissingReadOnlyPropertyAssignRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ public function testRule(): void
137137
'Readonly property MissingReadOnlyPropertyAssign\AdditionalAssignOfReadonlyPromotedProperty::$x is already assigned.',
138138
188,
139139
],
140-
/*[
140+
[
141141
'Access to an uninitialized readonly property MissingReadOnlyPropertyAssign\MethodCalledFromConstructorBeforeAssign::$foo.',
142142
226,
143143
],
144144
[
145145
'Access to an uninitialized readonly property MissingReadOnlyPropertyAssign\MethodCalledTwice::$foo.',
146146
244,
147-
],*/
147+
],
148148
[
149149
'Class MissingReadOnlyPropertyAssign\PropertyAssignedOnDifferentObjectUninitialized has an uninitialized readonly property $foo. Assign it in the constructor.',
150150
264,

0 commit comments

Comments
 (0)