From b8be29526e698ee9170d6a418d119f2c3c99f53b Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 12 Feb 2024 08:46:32 +0000 Subject: [PATCH] Updated Rector to commit 62ba91690bda77bfa41075d5dda3d0487a869580 https://github.com/rectorphp/rector-src/commit/62ba91690bda77bfa41075d5dda3d0487a869580 [internal] Add RelatedConfigInterface to load external services (#5605) --- src/Application/VersionResolver.php | 4 ++-- src/Config/RectorConfig.php | 7 +++++++ .../DependencyInjection/RelatedConfigInterface.php | 12 ++++++++++++ vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_static.php | 1 + 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/Contract/DependencyInjection/RelatedConfigInterface.php diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 36748dfb127..54c6af0d805 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '8d524d4c3b4a8b506d558eec23caf1923e59bb81'; + public const PACKAGE_VERSION = '62ba91690bda77bfa41075d5dda3d0487a869580'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-02-12 15:43:59'; + public const RELEASE_DATE = '2024-02-12 08:44:21'; /** * @var int */ diff --git a/src/Config/RectorConfig.php b/src/Config/RectorConfig.php index bf16fde91c3..1ee62db8050 100644 --- a/src/Config/RectorConfig.php +++ b/src/Config/RectorConfig.php @@ -8,6 +8,7 @@ use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Configuration\Option; use Rector\Configuration\Parameter\SimpleParameterProvider; use Rector\Configuration\RectorConfigBuilder; +use Rector\Contract\DependencyInjection\RelatedConfigInterface; use Rector\Contract\Rector\ConfigurableRectorInterface; use Rector\Contract\Rector\RectorInterface; use Rector\DependencyInjection\Laravel\ContainerMemento; @@ -201,6 +202,12 @@ final class RectorConfig extends Container RectorConfigValidator::ensureNoDuplicatedClasses($rectorClasses); foreach ($rectorClasses as $rectorClass) { $this->rule($rectorClass); + if (\is_a($rectorClass, RelatedConfigInterface::class, \true)) { + /** @var RelatedConfigInterface $rector */ + $rector = $this->make($rectorClass); + Assert::file($rector->getConfigFile(), \sprintf('The config path "%s" in "%s::getConfigFile()" could not be found', $rector->getConfigFile(), \get_class($rector))); + $this->import($rector->getConfigFile()); + } } } /** diff --git a/src/Contract/DependencyInjection/RelatedConfigInterface.php b/src/Contract/DependencyInjection/RelatedConfigInterface.php new file mode 100644 index 00000000000..263e9ea567b --- /dev/null +++ b/src/Contract/DependencyInjection/RelatedConfigInterface.php @@ -0,0 +1,12 @@ + $baseDir . '/src/Console/ProcessConfigureDecorator.php', 'Rector\\Console\\Style\\RectorStyle' => $baseDir . '/src/Console/Style/RectorStyle.php', 'Rector\\Console\\Style\\SymfonyStyleFactory' => $baseDir . '/src/Console/Style/SymfonyStyleFactory.php', + 'Rector\\Contract\\DependencyInjection\\RelatedConfigInterface' => $baseDir . '/src/Contract/DependencyInjection/RelatedConfigInterface.php', 'Rector\\Contract\\DependencyInjection\\ResetableInterface' => $baseDir . '/src/Contract/DependencyInjection/ResetableInterface.php', 'Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface' => $baseDir . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php', 'Rector\\Contract\\Rector\\ConfigurableRectorInterface' => $baseDir . '/src/Contract/Rector/ConfigurableRectorInterface.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 387cd3af81d..5b006f7bab0 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -1432,6 +1432,7 @@ class ComposerStaticInit2d887a2f87c676eb32b3e04612865e54 'Rector\\Console\\ProcessConfigureDecorator' => __DIR__ . '/../..' . '/src/Console/ProcessConfigureDecorator.php', 'Rector\\Console\\Style\\RectorStyle' => __DIR__ . '/../..' . '/src/Console/Style/RectorStyle.php', 'Rector\\Console\\Style\\SymfonyStyleFactory' => __DIR__ . '/../..' . '/src/Console/Style/SymfonyStyleFactory.php', + 'Rector\\Contract\\DependencyInjection\\RelatedConfigInterface' => __DIR__ . '/../..' . '/src/Contract/DependencyInjection/RelatedConfigInterface.php', 'Rector\\Contract\\DependencyInjection\\ResetableInterface' => __DIR__ . '/../..' . '/src/Contract/DependencyInjection/ResetableInterface.php', 'Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface' => __DIR__ . '/../..' . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php', 'Rector\\Contract\\Rector\\ConfigurableRectorInterface' => __DIR__ . '/../..' . '/src/Contract/Rector/ConfigurableRectorInterface.php',