Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Explaining a standard (phpcs -e) that uses namespaces now works corre…

…ctly
  • Loading branch information...
commit 51ec16201fb60e00f77850dc8de69a04e91342be 1 parent da30d91
Greg Sherwood gsherwood authored

Showing 2 changed files with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +5 0 CodeSniffer/CLI.php
  2. +1 0  package.xml
5 CodeSniffer/CLI.php
@@ -732,6 +732,11 @@ public function explainStandard($standard)
732 732
733 733 foreach ($sniffs as $sniff) {
734 734 $parts = explode('_', $sniff);
  735 + if (isset($parts[3]) === false) {
  736 + // Might be using namespaces.
  737 + $parts = explode('\\', $sniff);
  738 + }
  739 +
735 740 if ($lastStandard === '') {
736 741 $lastStandard = $parts[0];
737 742 }
1  package.xml
@@ -34,6 +34,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
34 34 -- Thanks to Maik Penz for the patch
35 35 - The JS tokenizer now correctly identifies T_INLINE_ELSE tokens instead of leaving them as T_COLON
36 36 -- Thanks to Arnout Boks for the patch
  37 + - Explaining a standard (phpcs -e) that uses namespaces now works correctly
37 38 - Many more docs added for Generic sniffs, as well as a few from other standards
38 39 -- Thanks to Spencer Rinehart for the contribution
39 40 - Added Generic InlineHTMLSniff to ensure a file only contains PHP code

0 comments on commit 51ec162

Please sign in to comment.
Something went wrong with that request. Please try again.