Skip to content

Commit

Permalink
Squiz/SelfMemberReference: only strip leading namespace separator
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 24, 2018
1 parent 2664159 commit be8e52e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop
$prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($calledClassName - 1), null, true);
if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['code'] === T_NS_SEPARATOR) {
$declarationName = $this->getDeclarationNameWithNamespace($tokens, $calledClassName);
$declarationName = substr($declarationName, 1);
$declarationName = ltrim($declarationName, '\\');
$fullQualifiedClassName = $this->getNamespaceOfScope($phpcsFile, $currScope);
if ($fullQualifiedClassName === '\\') {
$fullQualifiedClassName = '';
Expand Down

0 comments on commit be8e52e

Please sign in to comment.