Skip to content

Commit

Permalink
Supporting namespaces using block format
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Oct 15, 2012
1 parent c4b92e4 commit 037f172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sniffs/NamingConventions/ValidNamespaceNameSniff.php
Expand Up @@ -50,7 +50,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
$filename = $phpcsFile->getFilename(); $filename = $phpcsFile->getFilename();
$ns = ''; $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']; $ns .= $tokens[$stackPtr + $i]['content'];
$i++; $i++;
} }
Expand Down
5 changes: 5 additions & 0 deletions tests/files/CakePHP/SniffTest/BlockNs_pass.php
@@ -0,0 +1,5 @@
<?php
namespace CakePHP\SniffTest {
class TestFile {
}
}

0 comments on commit 037f172

Please sign in to comment.