Skip to content

Commit d530d0f

Browse files
committed
Fixed bug #432 : Properties of custom sniffs cannot be configured
1 parent fddc61a commit d530d0f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CodeSniffer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,13 @@ private function _expandRulesetReference($ref, $rulesetDir, $depth=0)
979979
}
980980
}
981981

982-
if (is_file($ref) === false) {
982+
if (is_file($ref) === true) {
983+
if (substr($ref, -9) === 'Sniff.php') {
984+
// A single external sniff.
985+
self::$rulesetDirs[] = dirname(dirname(dirname($ref)));
986+
return array($ref);
987+
}
988+
} else {
983989
// See if this is a whole standard being referenced.
984990
$path = $this->getInstalledStandardPath($ref);
985991
if (self::isPharFile($path) === true && strpos($path, 'ruleset.xml') === false) {

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
5151
- Fixed errors tokenizing T_ELSEIF tokens on HHVM 3.5
5252
- Squiz ArrayDeclarationSniff is no longer tricked by comments after array values
5353
- PEAR IncludingFileSniff no longer produces invalid code when removing parenthesis from require/include statements
54+
- Fixed bug #432 : Properties of custom sniffs cannot be configured
5455
- Fixed bug #453 : PSR2 standard does not allow closing tag for mixed PHP/HTML files
5556
- Fixed bug #457 : FunctionCallSignature sniffs do not support here/nowdoc syntax and can cause syntax error when fixing
5657
- Fixed bug #466 : PropertyLabelSpacing JS fixer issue when there is no space after colon

0 commit comments

Comments
 (0)