Skip to content

Commit

Permalink
Change property value from "1" to true in phpcs.xml.dist
Browse files Browse the repository at this point in the history
The ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach is a boolean value.
It should be set to true. If it is set to the string "1" Slevomat will
break with the following message:

PHP Fatal error:  Uncaught TypeError: Return value of
[...]\UnusedVariableSniff::isValueInForeachAndErrorIsIgnored() must be
of the type bool, string returned in
[...]/vendorr/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php:528

This effects Slevomat 7.0.19.

Change-Id: I8a0277bb3ba977c76677f70aa57c079cd3becfab
Issue-Link: https://project.pronovix.net/issues/4735
  • Loading branch information
lekob committed Mar 3, 2022
1 parent b55355a commit ba2ee4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="1"/>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
Expand Down

0 comments on commit ba2ee4e

Please sign in to comment.