File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,6 @@ public function process(File $phpcsFile, $stackPtr)
101
101
break ;
102
102
}
103
103
104
- if (isset ($ tokens [$ commentEnd ]['comment_opener ' ]) === true ) {
105
- $ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
106
- }
107
-
108
104
$ methodName = $ phpcsFile ->getDeclarationName ($ stackPtr );
109
105
if ($ tokens [$ commentEnd ]['code ' ] !== T_DOC_COMMENT_CLOSE_TAG
110
106
&& $ tokens [$ commentEnd ]['code ' ] !== T_COMMENT
@@ -118,7 +114,7 @@ public function process(File $phpcsFile, $stackPtr)
118
114
// Method prohibited to have docblock.
119
115
$ fix = $ phpcsFile ->addFixableError ("It's forbidden to document $ methodName function " , $ stackPtr , 'DocProhibited ' );
120
116
if ($ fix === true ) {
121
- for ($ i = $ commentStart ; $ i <= $ commentEnd ; $ i ++) {
117
+ for ($ i = $ tokens [ $ commentEnd ][ ' comment_opener ' ] ; $ i <= $ commentEnd ; $ i ++) {
122
118
$ phpcsFile ->fixer ->replaceToken ($ i , '' );
123
119
}
124
120
}
@@ -161,6 +157,7 @@ public function process(File $phpcsFile, $stackPtr)
161
157
return ;
162
158
}
163
159
160
+ $ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
164
161
foreach ($ tokens [$ commentStart ]['comment_tags ' ] as $ tag ) {
165
162
// This is a file comment, not a function comment.
166
163
if ($ tokens [$ tag ]['content ' ] === '@file ' ) {
You can’t perform that action at this time.
0 commit comments