Skip to content

Commit db870d6

Browse files
authored
Merge pull request #651 from PHPCSStandards/feature/phpcs-ruleset-minor-tweak
PHPCS ruleset: allow for trailing annotations
2 parents 0d3cab5 + 1c620d9 commit db870d6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

phpcs.xml.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
<rule ref="Squiz.Commenting.EmptyCatchComment"/>
4242
<rule ref="Squiz.Commenting.InlineComment"/>
4343
<rule ref="Squiz.Commenting.LongConditionClosingComment"/>
44-
<rule ref="Squiz.Commenting.PostStatementComment"/>
44+
<rule ref="Squiz.Commenting.PostStatementComment">
45+
<exclude name="Squiz.Commenting.PostStatementComment.AnnotationFound"/>
46+
</rule>
4547
<rule ref="Squiz.Commenting.VariableComment"/>
4648
<rule ref="Squiz.Formatting.OperatorBracket"/>
4749
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>

src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function isArrayStatic(File $phpcsFile, $arrayToken)
146146
$end = $tokens[$arrayToken]['parenthesis_closer'];
147147
} else {
148148
// Shouldn't be possible but may happen if external sniffs are using this method.
149-
return true;
149+
return true; // @codeCoverageIgnore
150150
}
151151

152152
$staticTokens = Tokens::$emptyTokens;

src/Standards/Generic/Sniffs/Strings/UnnecessaryHeredocSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function process(File $phpcsFile, $stackPtr)
4444
if (isset($tokens[$stackPtr]['scope_closer']) === false) {
4545
// Just to be safe. Shouldn't be possible as in that case, the opener shouldn't be tokenized
4646
// to T_START_HEREDOC by PHP.
47-
return;
47+
return; // @codeCoverageIgnore
4848
}
4949

5050
$closer = $tokens[$stackPtr]['scope_closer'];

src/Util/Help.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ private function printUsage()
270270
{
271271
$command = 'phpcs';
272272
if (defined('PHP_CODESNIFFER_CBF') === true && PHP_CODESNIFFER_CBF === true) {
273-
// @codeCoverageIgnore
274-
$command = 'phpcbf';
273+
$command = 'phpcbf'; // @codeCoverageIgnore
275274
}
276275

277276
$this->printCategoryHeader('Usage');

0 commit comments

Comments
 (0)