Updated Rector to commit 6c7dbaad0ab67dd06cef9237fab3728ae4f23e9a

6c7dbaad0a config method must be static, to avoid creating rule before loading related ctor services (#5606)
This commit is contained in:
Tomas Votruba 2024-02-12 08:57:06 +00:00
parent b8be29526e
commit 06f50472a3
3 changed files with 10 additions and 9 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '62ba91690bda77bfa41075d5dda3d0487a869580';
public const PACKAGE_VERSION = '6c7dbaad0ab67dd06cef9237fab3728ae4f23e9a';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-02-12 08:44:21';
public const RELEASE_DATE = '2024-02-12 08:54:53';
/**
* @var int
*/

View File

@ -172,6 +172,13 @@ final class RectorConfig extends Container
$this->tag($rectorClass, RectorInterface::class);
// for cache invalidation in case of change
SimpleParameterProvider::addParameter(Option::REGISTERED_RECTOR_RULES, $rectorClass);
// for cache invalidation in case of change
SimpleParameterProvider::addParameter(Option::REGISTERED_RECTOR_RULES, $rectorClass);
if (\is_a($rectorClass, RelatedConfigInterface::class, \true)) {
$configFile = $rectorClass::getConfigFile();
Assert::file($configFile, \sprintf('The config path "%s" in "%s::getConfigFile()" could not be found', $configFile, $rectorClass));
$this->import($configFile);
}
}
/**
* @param class-string<Command> $commandClass
@ -202,12 +209,6 @@ 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());
}
}
}
/**

View File

@ -8,5 +8,5 @@ namespace Rector\Contract\DependencyInjection;
*/
interface RelatedConfigInterface
{
public function getConfigFile() : string;
public static function getConfigFile() : string;
}