@@ -29,17 +29,21 @@ public function testPhp83AndPropertiesInInterface(): void
2929
3030 $ this ->analyse ([__DIR__ . '/data/properties-in-interface.php ' ], [
3131 [
32- 'Interfaces cannot include properties. ' ,
32+ 'Interfaces can include properties only on PHP 8.4 and later . ' ,
3333 7 ,
3434 ],
3535 [
36- 'Interfaces cannot include properties. ' ,
36+ 'Interfaces can include properties only on PHP 8.4 and later . ' ,
3737 9 ,
3838 ],
3939 [
40- 'Interfaces cannot include properties. ' ,
40+ 'Interfaces can include properties only on PHP 8.4 and later . ' ,
4141 11 ,
4242 ],
43+ [
44+ 'Interfaces can include properties only on PHP 8.4 and later. ' ,
45+ 13 ,
46+ ],
4347 ]);
4448 }
4549
@@ -54,11 +58,11 @@ public function testPhp83AndPropertyHooksInInterface(): void
5458
5559 $ this ->analyse ([__DIR__ . '/data/property-hooks-in-interface.php ' ], [
5660 [
57- 'Interfaces cannot include properties. ' ,
61+ 'Interfaces can include properties only on PHP 8.4 and later . ' ,
5862 7 ,
5963 ],
6064 [
61- 'Interfaces cannot include properties. ' ,
65+ 'Interfaces can include properties only on PHP 8.4 and later . ' ,
6266 9 ,
6367 ],
6468 ]);
@@ -79,6 +83,10 @@ public function testPhp84AndPropertiesInInterface(): void
7983 'Interfaces can only include hooked properties. ' ,
8084 11 ,
8185 ],
86+ [
87+ 'Interfaces can only include hooked properties. ' ,
88+ 13 ,
89+ ],
8290 ]);
8391 }
8492
@@ -140,6 +148,50 @@ public function testPhp84AndReadonlyPropertyHooksInInterface(): void
140148 ]);
141149 }
142150
151+ public function testPhp84AndFinalPropertyHooksInInterface (): void
152+ {
153+ if (PHP_VERSION_ID < 80400 ) {
154+ $ this ->markTestSkipped ('Test requires PHP 8.4 or later. ' );
155+ }
156+
157+ $ this ->analyse ([__DIR__ . '/data/final-property-hooks-in-interface.php ' ], [
158+ [
159+ 'Interfaces cannot include final properties. ' ,
160+ 7 ,
161+ ],
162+ [
163+ 'Interfaces cannot include final properties. ' ,
164+ 9 ,
165+ ],
166+ [
167+ 'Interfaces cannot include final properties. ' ,
168+ 11 ,
169+ ],
170+ [
171+ 'Property hook cannot be both abstract and final. ' ,
172+ 13 ,
173+ ],
174+ [
175+ 'Property hook cannot be both abstract and final. ' ,
176+ 17 ,
177+ ],
178+ ]);
179+ }
180+
181+ public function testPhp84AndExplicitAbstractProperty (): void
182+ {
183+ if (PHP_VERSION_ID < 80400 ) {
184+ $ this ->markTestSkipped ('Test requires PHP 8.4 or later. ' );
185+ }
186+
187+ $ this ->analyse ([__DIR__ . '/data/property-in-interface-explicit-abstract.php ' ], [
188+ [
189+ 'Property in interface cannot be explicitly abstract. ' ,
190+ 8 ,
191+ ],
192+ ]);
193+ }
194+
143195 public function testPhp84AndStaticHookedPropertyInInterface (): void
144196 {
145197 if (PHP_VERSION_ID < 80400 ) {
0 commit comments