mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-03 09:50:49 +00:00
aae549741f
0cb3fd0feb
[Php73] Handle crash Type Error on JsonThrowOnErrorRector (#4626)
21 lines
519 B
PHP
21 lines
519 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Testing\Fixture;
|
|
|
|
use Iterator;
|
|
use RectorPrefix202308\Symfony\Component\Finder\Finder;
|
|
final class FixtureFileFinder
|
|
{
|
|
/**
|
|
* @return Iterator<array<int, string>>
|
|
*/
|
|
public static function yieldDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
|
{
|
|
$finder = (new Finder())->in($directory)->files()->name($suffix);
|
|
foreach ($finder as $fileInfo) {
|
|
(yield [$fileInfo->getRealPath()]);
|
|
}
|
|
}
|
|
}
|