Skip to content

Commit

Permalink
Merge pull request #44 from peckadesign/fix-ignoreUnusedValuesWhenOnl…
Browse files Browse the repository at this point in the history
…yKeysAreUsedInForeach

Fix property ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach
  • Loading branch information
Spilky authored Apr 22, 2022
2 parents abf7aa1 + 4087974 commit 3cadd94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PeckaCodingStandard/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<!-- Variables -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="1" />
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
</properties>
</rule>
</ruleset>
2 changes: 1 addition & 1 deletion tests/Success/Variables/UnusedVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
echo $hello;

foreach ([] as $k => $v) {
echo $v;
echo $k;
}

0 comments on commit 3cadd94

Please sign in to comment.