File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,23 @@ public function register()
53
53
*/
54
54
public function process (File $ phpcsFile , $ stackPtr )
55
55
{
56
- $ tokens = $ phpcsFile ->getTokens ();
57
- $ find = Tokens::$ methodPrefixes ;
58
- $ find [T_WHITESPACE ] = T_WHITESPACE ;
59
- $ find [T_READONLY ] = T_READONLY ;
56
+ $ tokens = $ phpcsFile ->getTokens ();
57
+ $ find = ([
58
+ T_ABSTRACT => T_ABSTRACT ,
59
+ T_FINAL => T_FINAL ,
60
+ T_READONLY => T_READONLY ,
61
+ T_WHITESPACE => T_WHITESPACE ,
62
+ ] + Tokens::$ phpcsCommentTokens );
60
63
$ name = $ tokens [$ stackPtr ]['content ' ];
61
64
$ classCodeStart = $ stackPtr ;
62
65
63
66
$ previousContent = null ;
64
67
for ($ commentEnd = ($ stackPtr - 1 ); $ commentEnd >= 0 ; $ commentEnd --) {
65
68
if (isset ($ find [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
69
+ if (isset (Tokens::$ phpcsCommentTokens [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
70
+ $ classCodeStart = $ commentEnd ;
71
+ }
72
+
66
73
continue ;
67
74
}
68
75
@@ -78,7 +85,7 @@ public function process(File $phpcsFile, $stackPtr)
78
85
}
79
86
80
87
break ;
81
- }
88
+ }//end for
82
89
83
90
if ($ tokens [$ commentEnd ]['code ' ] !== T_DOC_COMMENT_CLOSE_TAG
84
91
&& $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT
Original file line number Diff line number Diff line change @@ -1905,3 +1905,12 @@ public function __construct(
1905
1905
) {}
1906
1906
1907
1907
}
1908
+
1909
+ /**
1910
+ * Doc block is here and an ignore directive is ok.
1911
+ */
1912
+ // phpcs:ignore Drupal.NamingConventions.ValidClassName
1913
+ enum PUROSELY_WRONG_BUT_OK : int {
1914
+ case One = 1 ;
1915
+ case Two = 2 ;
1916
+ }
You can’t perform that action at this time.
0 commit comments