Skip to content

Commit

Permalink
[Naming] Skip all kinds of generators (#5187)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Oct 18, 2023
1 parent 96fae07 commit 1a98723
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rules/Naming/Guard/BreakingVariableRenameGuard.php
Expand Up @@ -197,6 +197,10 @@ private function isGenerator(Param $param): bool
return false;
}

if (str_ends_with($paramType->getClassName(), 'Generator') || str_ends_with($paramType->getClassName(), 'Iterator')) {
return true;
}

return $paramType->isInstanceOf('Symfony\Component\DependencyInjection\Argument\RewindableGenerator')
->yes();
}
Expand Down

0 comments on commit 1a98723

Please sign in to comment.