add symfony php config option to allow loading route factory (#2339)

This commit is contained in:
Tomas Votruba 2022-05-21 10:42:08 +02:00 committed by GitHub
parent 36fd8fa619
commit fcadc67328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -178,6 +178,12 @@ final class RectorConfig extends ContainerConfigurator
$parameters->set(Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER, $filePath);
}
public function symfonyContainerPhp(string $filePath): void
{
$parameters = $this->parameters();
$parameters->set(Option::SYMFONY_CONTAINER_PHP_PATH_PARAMETER, $filePath);
}
public function symfonyRoutesJson(string $filePath): void
{
$parameters = $this->parameters();

View File

@ -72,6 +72,12 @@ final class Option
*/
public const SYMFONY_CONTAINER_XML_PATH_PARAMETER = 'symfony_container_xml_path';
/**
* @internal Use @see \Rector\Config\RectorConfig::symfonyContainerPhp()
* @var string
*/
public const SYMFONY_CONTAINER_PHP_PATH_PARAMETER = 'symfony_container_php_path';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::symfonyRoutesJson() instead
* @var string

View File

@ -21,4 +21,9 @@ final class RectorConfigProvider
{
return $this->parameterProvider->provideBoolParameter(Option::AUTO_IMPORT_NAMES);
}
public function getSymfonyContainerPhp(): string
{
return $this->parameterProvider->provideStringParameter(Option::SYMFONY_CONTAINER_PHP_PATH_PARAMETER);
}
}