Skip to content

Commit e478364

Browse files
Coding standards
1 parent d9cab8c commit e478364

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class FunctionCommentSniff implements Sniff
2525
{
2626

2727
/**
28+
* List of methods that are prohibited to have docblock.
29+
*
2830
* @var array<string>
2931
*/
3032
public $commentProhibitedFunctions = [];
@@ -98,7 +100,8 @@ public function process(File $phpcsFile, $stackPtr)
98100

99101
break;
100102
}
101-
if (isset($tokens[$commentEnd]['comment_opener'])) {
103+
104+
if (isset($tokens[$commentEnd]['comment_opener']) === true) {
102105
$commentStart = $tokens[$commentEnd]['comment_opener'];
103106
}
104107

@@ -111,13 +114,12 @@ public function process(File $phpcsFile, $stackPtr)
111114
// @see https://www.drupal.org/project/coder/issues/3400560.
112115
return;
113116
}
114-
}
115-
elseif (in_array($methodName, $this->commentProhibitedFunctions, true)) {
117+
} else if (in_array($methodName, $this->commentProhibitedFunctions, true) === true) {
116118
// Method prohibited to have docblock.
117119
$fix = $phpcsFile->addFixableError("It's forbidden to document $methodName function", $stackPtr, 'DocProhibited');
118120
if ($fix === true) {
119121
for ($i = $commentStart; $i <= $commentEnd; $i++) {
120-
$phpcsFile->fixer->replaceToken($i, '');
122+
$phpcsFile->fixer->replaceToken($i, '');
121123
}
122124
}
123125

0 commit comments

Comments
 (0)