vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php 1 location
|
@@ 129-139 (lines=11) @@
|
| 126 |
|
$isSpecialMethod = ($methodName === '__construct' || $methodName === '__destruct'); |
| 127 |
|
|
| 128 |
|
$return = null; |
| 129 |
|
foreach ($tokens[$commentStart]['comment_tags'] as $tag) { |
| 130 |
|
if ($tokens[$tag]['content'] === '@return') { |
| 131 |
|
if ($return !== null) { |
| 132 |
|
$error = 'Only 1 @return tag is allowed in a function comment'; |
| 133 |
|
$phpcsFile->addError($error, $tag, 'DuplicateReturn'); |
| 134 |
|
return; |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
$return = $tag; |
| 138 |
|
} |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
if ($isSpecialMethod === true) { |
| 142 |
|
return; |
vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php 1 location
|
@@ 62-72 (lines=11) @@
|
| 59 |
|
$isSpecialMethod = ($methodName === '__construct' || $methodName === '__destruct'); |
| 60 |
|
|
| 61 |
|
$return = null; |
| 62 |
|
foreach ($tokens[$commentStart]['comment_tags'] as $tag) { |
| 63 |
|
if ($tokens[$tag]['content'] === '@return') { |
| 64 |
|
if ($return !== null) { |
| 65 |
|
$error = 'Only 1 @return tag is allowed in a function comment'; |
| 66 |
|
$phpcsFile->addError($error, $tag, 'DuplicateReturn'); |
| 67 |
|
return; |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
$return = $tag; |
| 71 |
|
} |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
if ($isSpecialMethod === true) { |
| 75 |
|
return; |