Updated Rector to commit 5371408babdacb17ccbbe89b4c74281dcb4825c1

5371408bab [Container] Add RectorConfig::containerCacheDirectory() (#3490)
This commit is contained in:
Tomas Votruba 2023-03-19 20:28:32 +00:00
parent 1391f51af4
commit 1af1cd5c12
8 changed files with 28 additions and 13 deletions

View File

@ -66,6 +66,7 @@ return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->fileExtensions(['php']);
$rectorConfig->nestedChainMethodCallLimit(120);
$rectorConfig->cacheDirectory(\sys_get_temp_dir() . '/rector_cached_files');
$rectorConfig->containerCacheDirectory(\sys_get_temp_dir());
$services = $rectorConfig->services();
$services->defaults()->public()->autowire()->autoconfigure();
$services->load('Rector\\', __DIR__ . '/../packages')->exclude([

View File

@ -176,9 +176,18 @@ final class RectorConfig extends ContainerConfigurator
}
public function cacheDirectory(string $directoryPath) : void
{
// cache directory path is created via mkdir in CacheFactory
// when not exists, so no need to validate $directoryPath is a directory
$parameters = $this->parameters();
$parameters->set(Option::CACHE_DIR, $directoryPath);
}
public function containerCacheDirectory(string $directoryPath) : void
{
// container cache directory path must be a directory on the first place
Assert::directory($directoryPath);
$parameters = $this->parameters();
$parameters->set(Option::CONTAINER_CACHE_DIRECTORY, $directoryPath);
}
/**
* @param class-string<CacheStorageInterface> $cacheClass
*/

View File

@ -55,7 +55,7 @@ final class PHPStanServicesFactory
$purifiedConfigFiles[] = $purifiedConfigFile;
}
$containerFactory = new ContainerFactory(\getcwd());
$this->container = $containerFactory->create(\sys_get_temp_dir(), $additionalConfigFiles, []);
$this->container = $containerFactory->create($parameterProvider->provideStringParameter(Option::CONTAINER_CACHE_DIRECTORY), $additionalConfigFiles, []);
// clear temporary files, after container is created
$filesystem = new Filesystem();
$filesystem->remove($purifiedConfigFiles);

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '13a25fea9ad99131399bc9f79050cc382627254b';
public const PACKAGE_VERSION = '5371408babdacb17ccbbe89b4c74281dcb4825c1';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-03-19 21:09:59';
public const RELEASE_DATE = '2023-03-19 21:23:49';
/**
* @var int
*/

View File

@ -180,4 +180,9 @@ final class Option
* @var string
*/
public const REMOVE_UNUSED_IMPORTS = 'remove-unused-imports';
/**
* @internal Use @see \Rector\Config\RectorConfig::containerCacheDirectory() method
* @var string
*/
public const CONTAINER_CACHE_DIRECTORY = 'container-cache-directory';
}

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitaf63ab9f53b13e9f827e909dd3db2145::getLoader();
return ComposerAutoloaderInitb7db68037830ca516c20ec2b65c9251e::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitaf63ab9f53b13e9f827e909dd3db2145
class ComposerAutoloaderInitb7db68037830ca516c20ec2b65c9251e
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitaf63ab9f53b13e9f827e909dd3db2145
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitaf63ab9f53b13e9f827e909dd3db2145', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb7db68037830ca516c20ec2b65c9251e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitaf63ab9f53b13e9f827e909dd3db2145', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitb7db68037830ca516c20ec2b65c9251e', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitb7db68037830ca516c20ec2b65c9251e::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitb7db68037830ca516c20ec2b65c9251e::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145
class ComposerStaticInitb7db68037830ca516c20ec2b65c9251e
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3127,9 +3127,9 @@ class ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaf63ab9f53b13e9f827e909dd3db2145::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitb7db68037830ca516c20ec2b65c9251e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb7db68037830ca516c20ec2b65c9251e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb7db68037830ca516c20ec2b65c9251e::$classMap;
}, null, ClassLoader::class);
}