Skip to content

Commit

Permalink
Slevomat.Namespaces.ReferenceUsedNamesOnly: Fixed fixer when there's …
Browse files Browse the repository at this point in the history
…conflict with Slevomat.Namespaces.UnusedUses
  • Loading branch information
kukulich committed Nov 10, 2022
1 parent 1c0f295 commit 94fd4f9
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -470,6 +470,11 @@ static function (bool $carry, string $use) use ($canonicalName): bool {

$nameToReference = $useStatement->getNameAsReferencedInFile();
$addUse = false;
// Lock the use statement, so it is not modified by other sniffs
$phpcsFile->fixer->replaceToken(
$useStatement->getPointer(),
$phpcsFile->fixer->getTokenContent($useStatement->getPointer())
);
break;
}

Expand Down

0 comments on commit 94fd4f9

Please sign in to comment.