Skip to content
Permalink
Browse files

Added support for a phpcs.xml.dist file (request #583)

  • Loading branch information...
gsherwood committed Nov 25, 2015
1 parent 6167224 commit 85cbd465be37278e5d532ab1be6390d1c0df0ae2
Showing with 9 additions and 1 deletion.
  1. +2 −1 CodeSniffer.php
  2. +5 −0 CodeSniffer/CLI.php
  3. +2 −0 package.xml
@@ -2207,7 +2207,8 @@ public static function isInstalledStandard($standard)
// Might be an actual ruleset file itself.
// If it has an XML extension, let's at least try it.
if (is_file($standard) === true
&& substr(strtolower($standard), -4) === '.xml'
&& (substr(strtolower($standard), -4) === '.xml'
|| substr(strtolower($standard), -9) === '.xml.dist')
) {
return true;
}
@@ -1008,6 +1008,11 @@ public function validateStandard($standards)
return array($default);
}
$default = $currentDir.DIRECTORY_SEPARATOR.'phpcs.xml.dist';
if (is_file($default) === true) {
return array($default);
}
$currentDir = dirname($currentDir);
} while ($currentDir !== DIRECTORY_SEPARATOR && $currentDir !== '.');
@@ -29,6 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- PHPCS will now look for a phpcs.xml file in parent directories as well as the current directory (request #626)
- PHPCS will now use a phpcs.xml file even if files are specified on the command line
-- This file is still only used if no standard is specified on the command line
- Added support for a phpcs.xml.dist file (request #583)
-- If both a phpcs.xml and phpcs.xml.dist file are present, the phpcs.xml file will be used
- Fixed bug #784 : $this->trait is seen as a T_TRAIT token
- Fixed bug #786 : Switch indent issue with short array notation
</notes>

0 comments on commit 85cbd46

Please sign in to comment.
You can’t perform that action at this time.