mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
ec3d78eef4
5a3a59c50c
Remove collectors, as performance very costly and not practically useful (#5470)
35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace RectorPrefix202401;
|
|
|
|
use RectorPrefix202401\OndraM\CiDetector\CiDetector;
|
|
use Rector\Bootstrap\ExtensionConfigResolver;
|
|
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
|
|
use Rector\Config\RectorConfig;
|
|
return static function (RectorConfig $rectorConfig) : void {
|
|
$rectorConfig->paths([]);
|
|
$rectorConfig->skip([]);
|
|
$rectorConfig->autoloadPaths([]);
|
|
$rectorConfig->bootstrapFiles([]);
|
|
$rectorConfig->parallel();
|
|
// to avoid autoimporting out of the box
|
|
$rectorConfig->importNames(\false, \false);
|
|
$rectorConfig->removeUnusedImports(\false);
|
|
$rectorConfig->importShortClasses();
|
|
$rectorConfig->indent(' ', 4);
|
|
$rectorConfig->fileExtensions(['php']);
|
|
$rectorConfig->cacheDirectory(\sys_get_temp_dir() . '/rector_cached_files');
|
|
$rectorConfig->containerCacheDirectory(\sys_get_temp_dir());
|
|
// use faster in-memory cache in CI.
|
|
// CI always starts from scratch, therefore IO intensive caching is not worth it
|
|
if ((new CiDetector())->isCiDetected()) {
|
|
$rectorConfig->cacheClass(MemoryCacheStorage::class);
|
|
}
|
|
// load internal rector-* extension configs
|
|
$extensionConfigResolver = new ExtensionConfigResolver();
|
|
foreach ($extensionConfigResolver->provide() as $extensionConfigFile) {
|
|
$rectorConfig->import($extensionConfigFile);
|
|
}
|
|
};
|