Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Oct 30, 2023
1 parent bec4a65 commit d7d6c65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Fixer/Import/OrderedImportsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,16 @@ private function setNewOrder(Tokens $tokens, array $usesOrder): void
$use['namespace']
);

$numberOfInitial0TokensToClear = 3; // clear `<?php use `
$numberOfInitialTokensToClear = 3; // clear `<?php use `
if (self::IMPORT_TYPE_CLASS !== $use['importType']) {
$prevIndex = $tokens->getPrevMeaningfulToken($index);
if ($tokens[$prevIndex]->equals(',')) {
$numberOfInitial0TokensToClear = 5; // clear `<?php use const ` or `<?php use function `
$numberOfInitialTokensToClear = 5; // clear `<?php use const ` or `<?php use function `
}
}

$declarationTokens = Tokens::fromCode($code);
$declarationTokens->clearRange(0, $numberOfInitial0TokensToClear - 1);
$declarationTokens->clearRange(0, $numberOfInitialTokensToClear - 1);
$declarationTokens->clearAt(\count($declarationTokens) - 1); // clear `;`
$declarationTokens->clearEmptyTokens();

Expand Down

0 comments on commit d7d6c65

Please sign in to comment.