Permalink
Browse files

Fixed bug #19969 : Sniffs with namespace not recognized in reports

  • Loading branch information...
1 parent 6a9b3d2 commit 8a71e83f7a3cea61b81adbca5af5d9bceaf826e7 @gsherwood gsherwood committed Jun 12, 2013
Showing with 11 additions and 0 deletions.
  1. +10 −0 CodeSniffer/File.php
  2. +1 −0 package.xml
View
@@ -731,6 +731,11 @@ public function addError($error, $stackPtr, $code='', $data=array(), $severity=0
$sniff = $code;
} else {
$parts = explode('_', $this->_activeListener);
+ if (isset($parts[3]) === false) {
+ // Might be using namespaces.
+ $parts = explode('\\', $this->_activeListener);
+ }
+
if (isset($parts[3]) === true) {
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
@@ -852,6 +857,11 @@ public function addWarning($warning, $stackPtr, $code='', $data=array(), $severi
$sniff = $code;
} else {
$parts = explode('_', $this->_activeListener);
+ if (isset($parts[3]) === false) {
+ // Might be using namespaces.
+ $parts = explode('\\', $this->_activeListener);
+ }
+
if (isset($parts[3]) === true) {
$sniff = $parts[0].'.'.$parts[2].'.'.$parts[3];
View
@@ -60,6 +60,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19953 : PSR2 - Spaces before interface name for abstract class
- Fixed bug #19956 : phpcs warns for Type Hint missing Resource
- Fixed bug #19957 : Does not understand trait method aliasing
+ - Fixed bug #19969 : Sniffs with namespace not recognized in reports
</notes>
<contents>
<dir name="/">

0 comments on commit 8a71e83

Please sign in to comment.