File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ public function process(File $phpcsFile, $stackPtr)
63
63
$ name = $ tokens [$ stackPtr ]['content ' ];
64
64
$ classCodeStart = $ stackPtr ;
65
65
66
- $ previousContent = null ;
67
66
for ($ commentEnd = ($ stackPtr - 1 ); $ commentEnd >= 0 ; $ commentEnd --) {
68
67
if (isset ($ find [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
69
68
if (isset (Tokens::$ phpcsCommentTokens [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
@@ -73,10 +72,6 @@ public function process(File $phpcsFile, $stackPtr)
73
72
continue ;
74
73
}
75
74
76
- if ($ previousContent === null ) {
77
- $ previousContent = $ commentEnd ;
78
- }
79
-
80
75
if ($ tokens [$ commentEnd ]['code ' ] === T_ATTRIBUTE_END
81
76
&& isset ($ tokens [$ commentEnd ]['attribute_opener ' ]) === true
82
77
) {
Original file line number Diff line number Diff line change @@ -75,12 +75,16 @@ public function register()
75
75
public function process (File $ phpcsFile , $ stackPtr )
76
76
{
77
77
$ tokens = $ phpcsFile ->getTokens ();
78
- $ ignore = Tokens::$ methodPrefixes ;
78
+ $ ignore = ( Tokens::$ methodPrefixes + Tokens:: $ phpcsCommentTokens ) ;
79
79
$ ignore [T_WHITESPACE ] = T_WHITESPACE ;
80
80
$ functionCodeStart = $ stackPtr ;
81
81
82
82
for ($ commentEnd = ($ stackPtr - 1 ); $ commentEnd >= 0 ; $ commentEnd --) {
83
83
if (isset ($ ignore [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
84
+ if (isset (Tokens::$ phpcsCommentTokens [$ tokens [$ commentEnd ]['code ' ]]) === true ) {
85
+ $ functionCodeStart = $ commentEnd ;
86
+ }
87
+
84
88
continue ;
85
89
}
86
90
Original file line number Diff line number Diff line change @@ -1914,3 +1914,11 @@ enum PUROSELY_WRONG_BUT_OK: int {
1914
1914
case One = 1 ;
1915
1915
case Two = 2 ;
1916
1916
}
1917
+
1918
+ /**
1919
+ * Doc block is here and an ignore directive is ok.
1920
+ */
1921
+ // phpcs:ignore Drupal.NamingConventions.ValidClassName
1922
+ function phpcs_ignore_comment () {
1923
+
1924
+ }
You can’t perform that action at this time.
0 commit comments