Skip to content

Commit

Permalink
Merge pull request #22 from leroy-merlin-br/sniff/useless-variable
Browse files Browse the repository at this point in the history
Add sniff to forbid useless variables on returns
  • Loading branch information
carusogabriel authored Feb 13, 2019
2 parents 89b61cb + bfdbcd1 commit da69134
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/LeroyMerlin/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
</rule>
<!-- Forbid duplicated variables assignments -->
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<!-- Forbid useless variables -->
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<!-- Forbid spaces around square brackets -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<!-- Force array declaration structure -->
Expand Down
4 changes: 1 addition & 3 deletions tests/expected/example-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public function mangleBar(int $length): void

public static function getMinorVersion(): int
{
$version = self::VERSION;

return $version;
return self::VERSION;
}

public static function getTestCase(): TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tests/input/useless-semicolon.php 4 0
----------------------------------------------------------------------
A TOTAL OF 129 ERRORS AND 0 WARNINGS WERE FOUND IN 17 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 115 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 116 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


0 comments on commit da69134

Please sign in to comment.