@@ -559,6 +559,7 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
559
559
* 'is_static' => boolean, // TRUE if the static keyword was found.
560
560
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
561
561
* 'is_final' => boolean, // TRUE if the final keyword was found.
562
+ * 'is_abstract' => boolean, // TRUE if the abstract keyword was found.
562
563
* 'type' => string, // The type of the var (empty if no type specified).
563
564
* 'type_token' => integer|false, // The stack pointer to the start of the type
564
565
* // or FALSE if there is no type.
@@ -573,13 +574,16 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
573
574
*
574
575
* Changelog for the PHPCS native function:
575
576
* - Introduced in PHPCS 0.0.5.
577
+ * - PHPCS 3.13.3: support for PHP 8.4 abstract properties.
576
578
* - PHPCS 4.0: properties in interfaces (PHP 8.4+) are accepted.
577
579
* - PHPCS 4.0: will no longer throw a parse error warning.
578
580
*
579
581
* @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source.
580
582
* @see \PHPCSUtils\Utils\Variables::getMemberProperties() PHPCSUtils native improved version.
581
583
*
582
584
* @since 1.0.0
585
+ * @since 1.1.0 Sync with PHPCS 4.0.0, remove parse error warning and support PHP 8.4 properties in interfaces. PHPCS(new)#991
586
+ * @since 1.1.2 Sync with PHPCS 3.13.3, support for abstract properties. PHPCS(new)#xxx
583
587
*
584
588
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
585
589
* @param int $stackPtr The position in the stack of the `T_VARIABLE` token to
@@ -626,6 +630,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
626
630
T_VAR => T_VAR ,
627
631
T_READONLY => T_READONLY ,
628
632
T_FINAL => T_FINAL ,
633
+ T_ABSTRACT => T_ABSTRACT ,
629
634
];
630
635
631
636
$ valid += Tokens::$ scopeModifiers ;
@@ -637,6 +642,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
637
642
$ isStatic = false ;
638
643
$ isReadonly = false ;
639
644
$ isFinal = false ;
645
+ $ isAbstract = false ;
640
646
641
647
$ startOfStatement = $ phpcsFile ->findPrevious (
642
648
[
@@ -684,6 +690,9 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
684
690
case T_FINAL :
685
691
$ isFinal = true ;
686
692
break ;
693
+ case T_ABSTRACT :
694
+ $ isAbstract = true ;
695
+ break ;
687
696
}
688
697
}
689
698
@@ -728,6 +737,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
728
737
'is_static ' => $ isStatic ,
729
738
'is_readonly ' => $ isReadonly ,
730
739
'is_final ' => $ isFinal ,
740
+ 'is_abstract ' => $ isAbstract ,
731
741
'type ' => $ type ,
732
742
'type_token ' => $ typeToken ,
733
743
'type_end_token ' => $ typeEndToken ,
0 commit comments