File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,23 @@ public function testBug11495(): void
162
162
$ this ->markTestSkipped ('Test requires PHP 8.1. ' );
163
163
}
164
164
165
- $ errors = [];
166
165
if (PHP_VERSION_ID < 80300 ) {
167
- $ errors [] = [
168
- 'Readonly property Bug11495\HelloWorld::$foo is assigned outside of the constructor. ' ,
169
- 17 ,
166
+ $ errors = [
167
+ [
168
+ 'Readonly property Bug11495\HelloWorld::$foo is assigned outside of the constructor. ' ,
169
+ 17 ,
170
+ ],
171
+ [
172
+ 'Readonly property Bug11495\HelloWorld::$foo is assigned outside of the constructor. ' ,
173
+ 20 ,
174
+ ],
175
+ ];
176
+ } else {
177
+ $ errors = [
178
+ [
179
+ 'Readonly property Bug11495\HelloWorld::$foo is not assigned on $this. ' ,
180
+ 20 ,
181
+ ],
170
182
];
171
183
}
172
184
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ public function __construct()
15
15
public function __clone ()
16
16
{
17
17
$ this ->foo = 'baz ' ;
18
+
19
+ $ s = new self ();
20
+ $ s ->foo = 'baz ' ;
18
21
}
19
22
20
23
public function getFoo (): string
You can’t perform that action at this time.
0 commit comments