2020-09-18 12:06:01 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-09-06 05:59:31 +00:00
|
|
|
namespace RectorPrefix20210906;
|
2020-09-18 12:06:01 +02:00
|
|
|
|
2021-07-28 07:05:44 +00:00
|
|
|
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
|
2020-09-18 12:06:01 +02:00
|
|
|
use Rector\Core\Configuration\Option;
|
2021-06-02 10:21:10 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
|
2020-09-18 12:06:01 +02:00
|
|
|
$parameters = $containerConfigurator->parameters();
|
2021-03-15 14:19:57 +01:00
|
|
|
// paths and extensions
|
2021-05-10 22:23:08 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::PATHS, []);
|
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::FILE_EXTENSIONS, ['php']);
|
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::AUTOLOAD_PATHS, []);
|
2021-03-23 19:53:39 +01:00
|
|
|
// these files will be executed, useful e.g. for constant definitions
|
2021-05-10 22:23:08 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::BOOTSTRAP_FILES, []);
|
2021-03-15 14:19:57 +01:00
|
|
|
// FQN class importing
|
2021-05-10 22:23:08 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::AUTO_IMPORT_NAMES, \false);
|
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::IMPORT_SHORT_CLASSES, \true);
|
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::IMPORT_DOC_BLOCKS, \true);
|
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, null);
|
2021-07-04 13:13:54 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::NESTED_CHAIN_METHOD_CALL_LIMIT, 60);
|
2021-05-10 22:23:08 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::SKIP, []);
|
2021-05-15 11:14:40 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::PHPSTAN_FOR_RECTOR_PATH, null);
|
2021-03-15 14:19:57 +01:00
|
|
|
// cache
|
2021-05-10 22:23:08 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::CACHE_DIR, \sys_get_temp_dir() . '/rector_cached_files');
|
2021-07-28 07:05:44 +00:00
|
|
|
// use faster in-memory cache in CI.
|
|
|
|
// CI always starts from scratch, therefore IO intensive caching is not worth it
|
|
|
|
$runsInGithubAction = \getenv('GITHUB_ACTION');
|
2021-07-28 10:00:12 +00:00
|
|
|
if ($runsInGithubAction !== \false) {
|
2021-07-28 07:05:44 +00:00
|
|
|
$parameters->set(\Rector\Core\Configuration\Option::CACHE_CLASS, \Rector\Caching\ValueObject\Storage\MemoryCacheStorage::class);
|
|
|
|
}
|
2020-09-18 12:06:01 +02:00
|
|
|
};
|