-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue where including sniffs using paths containing multiple…
… dots would silently fail (ref #2847) This also fixes an issue where the unit tests were failing when run from a an extracted PEAR archive
- Loading branch information
Showing
4 changed files
with
93 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="RuleInclusionTest" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | ||
|
||
<rule ref="PSR1"> | ||
<properties> | ||
<property name="setforallsniffs" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Zend.NamingConventions"> | ||
<properties> | ||
<property name="setforallincategory" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Arrays.ArrayIndent"> | ||
<properties> | ||
<property name="indent" value="2" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Metrics.CyclomaticComplexity.MaxExceeded"> | ||
<properties> | ||
<property name="complexity" value="50" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./src/Standards/Generic/Sniffs/Files/LineLengthSniff.php"> | ||
<properties> | ||
<property name="lineLimit" value="10" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./../PHP_CodeSniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php"> | ||
<properties> | ||
<property name="strict" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./RuleInclusionTest-include.xml"> | ||
<properties> | ||
<property name="setforsniffsinincludedruleset" value="true" /> | ||
</properties> | ||
</rule> | ||
<rule ref="PSR1"> | ||
<properties> | ||
<property name="setforallsniffs" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Zend.NamingConventions"> | ||
<properties> | ||
<property name="setforallincategory" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Arrays.ArrayIndent"> | ||
<properties> | ||
<property name="indent" value="2" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Metrics.CyclomaticComplexity.MaxExceeded"> | ||
<properties> | ||
<property name="complexity" value="50" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./src/Standards/Generic/Sniffs/Files/LineLengthSniff.php"> | ||
<properties> | ||
<property name="lineLimit" value="10" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./../%path_root_dir%/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php"> | ||
<properties> | ||
<property name="strict" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./RuleInclusionTest-include.xml"> | ||
<properties> | ||
<property name="setforsniffsinincludedruleset" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
</ruleset> |
I'd suggest that a strict
in_array()
comparison will be more stable here as this will compare strings and if anything, for whatever reason in the$newSniffs
array would not be a string, non-strict will be unreliable.