Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed

  • Loading branch information...
commit 4982619b53bf7cea6255bc1dac57b89096c046f4 1 parent 6ef511b
@gsherwood gsherwood authored
Showing with 12 additions and 1 deletion.
  1. +11 −1 CodeSniffer.php
  2. +1 −0  package.xml
View
12 CodeSniffer.php
@@ -321,7 +321,10 @@ public function setAllowedFileExtensions(array $extensions)
*
* Patterns are not case sensitive.
*
- * @param array $patterns An array of ignore patterns.
+ * @param array $patterns An array of ignore patterns. The pattern is the key
+ * and the value is either "absolute" or "relative",
+ * depending on how the pattern should be applied to a
+ * file path.
*
* @return void
*/
@@ -1221,6 +1224,13 @@ public function shouldIgnoreFile($path, $basedir)
continue;
}
+ // Maintains backwards compatibility in case the ignore pattern does
+ // not have a relative/absolute value.
+ if (is_int($pattern) === true) {
+ $pattern = $type;
+ $type = 'absolute';
+ }
+
$replacements = array(
'\\,' => ',',
'*' => '.*',
View
1  package.xml
@@ -38,6 +38,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Thanks to Bart S for the patch
- Fixed bug #19819 : Freeze with syntax error in use statement
- Fixed bug #19820 : Wrong message level in Generic_Sniffs_CodeAnalysis_EmptyStatementSniff
+ - Fixed bug #19859 : CodeSniffer::setIgnorePatterns API changed
</notes>
<contents>
<dir name="/">
Please sign in to comment.
Something went wrong with that request. Please try again.