Skip to content

Commit

Permalink
magento#142: [New Rule] No imports from static tests namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaorobei committed Dec 11, 2019
1 parent 199057a commit 4040cd5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Magento2/Sniffs/Namespaces/ImportsFromTestNamespaceSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class ImportsFromTestNamespaceSniff implements Sniff
{

/**
* @var string
*/
Expand Down Expand Up @@ -53,7 +52,7 @@ public function process(File $phpcsFile, $stackPtr)
&& $tokens[$next]['code'] !== T_SEMICOLON
&& $tokens[$next]['code'] !== T_CLOSE_TAG
) {
$baseUse = rtrim($phpcsFile->getTokensAsString($stackPtr, ($next - $stackPtr)));
$baseUse = rtrim($phpcsFile->getTokensAsString($stackPtr, ($next - $stackPtr)));
$baseUse = str_replace('use \\', '', $baseUse);
$closingCurly = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($next + 1));
do {
Expand All @@ -64,7 +63,7 @@ public function process(File $phpcsFile, $stackPtr)
$phpcsFile->addWarning($this->warningMessage, $stackPtr, $this->warningCode);
return;
}
} while ($next != false);
} while ($next !== false);
}
}
}

0 comments on commit 4040cd5

Please sign in to comment.