mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-09 04:32:33 +00:00
671f50c702
ee71539694
[NodeTypeResolver] Use isScalar()->yes() usage on StaticTypeAnalyzer and ScalarTypeComparator services (#5099)
22 lines
559 B
PHP
22 lines
559 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Testing\Fixture;
|
|
|
|
use Iterator;
|
|
use RectorPrefix202310\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()]);
|
|
}
|
|
}
|
|
}
|