Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 9, 2024
1 parent 28baa2d commit 023d752
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,10 @@ private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $u

$types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex());

foreach ($types as $typeName => [$startIndex, $endIndex]) {
$shortType = $this->determineShortType($typeName, $uses, $namespaceName);

if (null !== $shortType) {
$tokens->overrideRange($startIndex, $endIndex, $shortType);
foreach ($types as $content => [$startIndex, $endIndex]) {
$newTokens = $this->determineShortType($content, $uses, $namespaceName);
if (null !== $newTokens) {
$tokens->overrideRange($startIndex, $endIndex, $newTokens);
}
}
}
Expand Down

0 comments on commit 023d752

Please sign in to comment.