Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
refactor: Replace foreach loop with yield from expression
Browse files Browse the repository at this point in the history
  • Loading branch information
k911 committed Feb 28, 2019
1 parent ab745c8 commit 8744f30
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Component/GeneratedCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ public function filter(callable $func): self
*/
public function getIterator(): Generator
{
foreach ($this->itemCollection as $handler) {
yield $handler;
}
yield from $this->itemCollection;

foreach ($this->items as $handler) {
yield $handler;
}
yield from $this->items;
}
}

0 comments on commit 8744f30

Please sign in to comment.