rector/bin/test-fixture-stats.php
Tomas Votruba dad1e77265 Updated Rector to commit fafa4013f6996e47724aad11d4ef0c10d3a9cd14
fafa4013f6 Cleanup few duplicated test fixtures, fix SimplifyEmptyCheckOnEmptyArrayRector test namespace (#6056)
2024-06-27 07:46:59 +00:00

27 lines
914 B
PHP

<?php
// this is part of downgrade build
declare (strict_types=1);
namespace RectorPrefix202406;
use RectorPrefix202406\Symfony\Component\Finder\Finder;
require __DIR__ . '/../vendor/autoload.php';
$finder = Finder::create()->in(__DIR__ . '/../rules-tests')->directories()->name('#Rector$#')->getIterator();
$ruleToFixtureCount = [];
foreach ($finder as $rectorTestDirectory) {
if ($rectorTestDirectory->getBasename() === 'Rector') {
continue;
}
$fixtureCount = Finder::create()->files()->name('*.php.inc')->in($rectorTestDirectory->getPathname())->count();
// very few fixture files, not relevant
if ($fixtureCount <= 15) {
continue;
}
$ruleToFixtureCount[$rectorTestDirectory->getBasename()] = $fixtureCount;
}
\asort($ruleToFixtureCount);
foreach ($ruleToFixtureCount as $rule => $fixtureCount) {
echo ' * ' . $rule . ': ';
echo $fixtureCount . \PHP_EOL;
}