Skip to content

Commit

Permalink
[Testing] Remove unnecessary iterator_to_array() on FixtureFileFinder (
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 11, 2023
1 parent 4db20ca commit 257395a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/Testing/Fixture/FixtureFileFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Iterator;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;

final class FixtureFileFinder
{
Expand All @@ -20,8 +19,7 @@ public static function yieldDirectory(string $directory, string $suffix = '*.php
->files()
->name($suffix);

$fileInfos = iterator_to_array($finder);
foreach ($fileInfos as $fileInfo) {
foreach ($finder as $fileInfo) {
yield [$fileInfo->getRealPath()];
}
}
Expand Down

0 comments on commit 257395a

Please sign in to comment.