File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ class FunctionCommentSniff implements Sniff
25
25
{
26
26
27
27
/**
28
+ * List of methods that are prohibited to have docblock.
29
+ *
28
30
* @var array<string>
29
31
*/
30
32
public $ commentProhibitedFunctions = [];
@@ -98,7 +100,8 @@ public function process(File $phpcsFile, $stackPtr)
98
100
99
101
break ;
100
102
}
101
- if (isset ($ tokens [$ commentEnd ]['comment_opener ' ])) {
103
+
104
+ if (isset ($ tokens [$ commentEnd ]['comment_opener ' ]) === true ) {
102
105
$ commentStart = $ tokens [$ commentEnd ]['comment_opener ' ];
103
106
}
104
107
@@ -111,13 +114,12 @@ public function process(File $phpcsFile, $stackPtr)
111
114
// @see https://www.drupal.org/project/coder/issues/3400560.
112
115
return ;
113
116
}
114
- }
115
- elseif (in_array ($ methodName , $ this ->commentProhibitedFunctions , true )) {
117
+ } else if (in_array ($ methodName , $ this ->commentProhibitedFunctions , true ) === true ) {
116
118
// Method prohibited to have docblock.
117
119
$ fix = $ phpcsFile ->addFixableError ("It's forbidden to document $ methodName function " , $ stackPtr , 'DocProhibited ' );
118
120
if ($ fix === true ) {
119
121
for ($ i = $ commentStart ; $ i <= $ commentEnd ; $ i ++) {
120
- $ phpcsFile ->fixer ->replaceToken ($ i , '' );
122
+ $ phpcsFile ->fixer ->replaceToken ($ i , '' );
121
123
}
122
124
}
123
125
You can’t perform that action at this time.
0 commit comments