Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Supporting namespaces using block format

  • Loading branch information...
commit 037f1727004cbdf4f6bb8fb7e4498d657e2f915c 1 parent c4b92e4
Juan Basso jrbasso authored
2  Sniffs/NamingConventions/ValidNamespaceNameSniff.php
View
@@ -50,7 +50,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
$filename = $phpcsFile->getFilename();
$ns = '';
- while ($tokens[$stackPtr + $i]['code'] !== T_SEMICOLON) {
+ while (!in_array($tokens[$stackPtr + $i]['code'], array(T_SEMICOLON, T_WHITESPACE, T_OPEN_CURLY_BRACKET))) {
$ns .= $tokens[$stackPtr + $i]['content'];
$i++;
}
5 tests/files/CakePHP/SniffTest/BlockNs_pass.php
View
@@ -0,0 +1,5 @@
+<?php
+namespace CakePHP\SniffTest {
+ class TestFile {
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.