@@ -255,7 +255,7 @@ final class MyAttributeClass {}
255255                namespace Foo; 
256256                use Attribute as TheAttributeClass; 
257257                #[TheAttributeClass(flags: TheAttributeClass::TARGET_METHOD)] 
258-                 abstract  class MyAttributeClass {} 
258+                 final  class MyAttributeClass {} 
259259                PHP,
260260        ];
261261    }
@@ -286,7 +286,7 @@ public static function provideFix82Cases(): iterable
286286                final readonly class NotAttributeClass1 {} 
287287
288288                #[Attribute(flags: Attribute::TARGET_METHOD)] 
289-                 abstract  readonly class MyAttributeClass {} 
289+                 final  readonly class MyAttributeClass {} 
290290
291291                /** 
292292                 * @no-named-arguments 
@@ -302,7 +302,7 @@ public static function provideFix82Cases(): iterable
302302                final readonly class NotAttributeClass1 {} 
303303
304304                #[Attribute(flags: Attribute::TARGET_METHOD)] 
305-                 abstract  readonly class MyAttributeClass {} 
305+                 final  readonly class MyAttributeClass {} 
306306
307307                #[FooAttribute] 
308308                #[BarAttribute] 
@@ -311,4 +311,40 @@ public static function provideFix82Cases(): iterable
311311                PHP,
312312        ];
313313    }
314+ 
315+     /** 
316+      * @dataProvider provideFixPre85Cases 
317+      * 
318+      * @requires PHP >= 8.0 
319+      * @requires PHP < 8.5 
320+      */ 
321+     public  function  testFixPre85 (string  $ expected , ?string  $ input  = null ): void 
322+     {
323+         $ this  ->doTest ($ expected , $ input );
324+     }
325+ 
326+     /** 
327+      * @return iterable<array{0: string, 1?: string}> 
328+      */ 
329+     public  static  function  provideFixPre85Cases (): iterable 
330+     {
331+         // the below case is fatal error in PHP 8.5+ (https://github.com/php/php-src/pull/19154) 
332+         yield  'always add for abstract attribute class '  => [
333+             <<<'PHP'
334+                 <?php 
335+                 namespace Foo; 
336+                 /** 
337+                  * @no-named-arguments 
338+                  */ 
339+                 #[\Attribute(flags: TheAttributeClass::TARGET_METHOD)] 
340+                 abstract class MyAttributeClass {} 
341+                 PHP,
342+             <<<'PHP'
343+                 <?php 
344+                 namespace Foo; 
345+                 #[\Attribute(flags: TheAttributeClass::TARGET_METHOD)] 
346+                 abstract class MyAttributeClass {} 
347+                 PHP,
348+         ];
349+     }
314350}
0 commit comments