@@ -524,7 +524,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
524
524
*
525
525
* Changelog for the PHPCS native function:
526
526
* - Introduced in PHPCS 0.0.5.
527
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
527
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
528
528
*
529
529
* @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source.
530
530
* @see \PHPCSUtils\Utils\FunctionDeclarations::getProperties() PHPCSUtils native improved version.
@@ -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 ,
@@ -751,7 +761,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
751
761
*
752
762
* Changelog for the PHPCS native function:
753
763
* - Introduced in PHPCS 1.3.0.
754
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
764
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
755
765
*
756
766
* @see \PHP_CodeSniffer\Files\File::getClassProperties() Original source.
757
767
* @see \PHPCSUtils\Utils\ObjectDeclarations::getClassProperties() PHPCSUtils native improved version.
@@ -779,7 +789,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
779
789
*
780
790
* Changelog for the PHPCS native function:
781
791
* - Introduced in PHPCS 0.0.5.
782
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
792
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
783
793
*
784
794
* @see \PHP_CodeSniffer\Files\File::isReference() Original source.
785
795
* @see \PHPCSUtils\Utils\Operators::isReference() PHPCSUtils native improved version.
@@ -805,7 +815,7 @@ public static function isReference(File $phpcsFile, $stackPtr)
805
815
*
806
816
* Changelog for the PHPCS native function:
807
817
* - Introduced in PHPCS 0.0.5.
808
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
818
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
809
819
*
810
820
* @see \PHP_CodeSniffer\Files\File::getTokensAsString() Original source.
811
821
* @see \PHPCSUtils\Utils\GetTokensAsString Related set of functions.
@@ -834,7 +844,7 @@ public static function getTokensAsString(File $phpcsFile, $start, $length, $orig
834
844
*
835
845
* Changelog for the PHPCS native function:
836
846
* - Introduced in PHPCS 2.1.0.
837
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
847
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
838
848
*
839
849
* @see \PHP_CodeSniffer\Files\File::findStartOfStatement() Original source.
840
850
*
@@ -858,7 +868,7 @@ public static function findStartOfStatement(File $phpcsFile, $start, $ignore = n
858
868
*
859
869
* Changelog for the PHPCS native function:
860
870
* - Introduced in PHPCS 2.1.0.
861
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
871
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
862
872
*
863
873
* @see \PHP_CodeSniffer\Files\File::findEndOfStatement() Original source.
864
874
*
@@ -882,7 +892,7 @@ public static function findEndOfStatement(File $phpcsFile, $start, $ignore = nul
882
892
*
883
893
* Changelog for the PHPCS native function:
884
894
* - Introduced in PHPCS 0.0.5.
885
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
895
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
886
896
*
887
897
* @see \PHP_CodeSniffer\Files\File::hasCondition() Original source.
888
898
* @see \PHPCSUtils\Utils\Conditions::hasCondition() PHPCSUtils native alternative.
@@ -907,7 +917,7 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types)
907
917
*
908
918
* Changelog for the PHPCS native function:
909
919
* - Introduced in PHPCS 1.3.0.
910
- * - The upstream method has received no significant updates since PHPCS 3.13.0 .
920
+ * - The upstream method has received no significant updates since PHPCS 3.13.3 .
911
921
*
912
922
* @see \PHP_CodeSniffer\Files\File::getCondition() Original source.
913
923
* @see \PHPCSUtils\Utils\Conditions::getCondition() More versatile alternative.
0 commit comments