mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 62ba91690bda77bfa41075d5dda3d0487a869580
62ba91690b
[internal] Add RelatedConfigInterface to load external services (#5605)
This commit is contained in:
parent
de79e08a92
commit
b8be29526e
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Contract\DependencyInjection;
|
||||
|
||||
/**
|
||||
* @internal Use for rules that require extra custom services.
|
||||
*/
|
||||
interface RelatedConfigInterface
|
||||
{
|
||||
public function getConfigFile() : string;
|
||||
}
|
|
@ -1213,6 +1213,7 @@ return array(
|
|||
'Rector\\Console\\ProcessConfigureDecorator' => $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',
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue