mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
184cf49468
f9de5d311e
[Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined (#5219)
22 lines
559 B
PHP
22 lines
559 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Testing\Fixture;
|
|
|
|
use Iterator;
|
|
use RectorPrefix202311\Symfony\Component\Finder\Finder;
|
|
final class FixtureFileFinder
|
|
{
|
|
/**
|
|
* @api used in tests
|
|
* @return Iterator<array<int, string>>
|
|
*/
|
|
public static function yieldDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
|
{
|
|
$finder = (new Finder())->in($directory)->files()->name($suffix)->sortByName();
|
|
foreach ($finder as $fileInfo) {
|
|
(yield [$fileInfo->getRealPath()]);
|
|
}
|
|
}
|
|
}
|