Skip to content

Commit 825f86a

Browse files
committed
Extensions specified on the CLI are now merged with those set in ruleset.xml files
1 parent cd85152 commit 825f86a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CodeSniffer/CLI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ public function processLongArgument($arg, $pos)
686686
$this->values['standard'] = explode(',', $standards);
687687
}
688688
} else if (substr($arg, 0, 11) === 'extensions=') {
689-
$this->values['extensions'] = explode(',', substr($arg, 11));
689+
$this->values['extensions'] = array_merge($this->values['extensions'], explode(',', substr($arg, 11)));
690690
} else if (substr($arg, 0, 9) === 'severity=') {
691691
$this->values['errorSeverity'] = (int) substr($arg, 9);
692692
$this->values['warningSeverity'] = $this->values['errorSeverity'];

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
4040
-- Useful for running the phpcs and phpcbf commands without any arguments at the top of a repository
4141
- Default file paths can now be specified in a ruleset.xml file using the "file" tag
4242
-- File paths are only processed if no files were specified on the command line
43+
- Extensions specified on the CLI are now merged with those set in ruleset.xml files
44+
-- Previously, the ruleset.xml file setting replaced the CLI setting completely
4345
- Squiz coding standard now requires lowercase PHP constants (true, false and null)
4446
-- Removed Squiz.NamingConventions.ConstantCase sniff as the rule is now consistent across PHP and JS files
4547
- Squiz FunctionOpeningBraceSpaceSniff no longer does additional checks for JS functions

0 commit comments

Comments
 (0)