Skip to content

Commit

Permalink
add symfony php config option to allow loading route factory (#2339)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 21, 2022
1 parent 36fd8fa commit fcadc67
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ public function symfonyContainerXml(string $filePath): void
$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();
Expand Down
6 changes: 6 additions & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/Configuration/RectorConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public function shouldImportNames(): bool
{
return $this->parameterProvider->provideBoolParameter(Option::AUTO_IMPORT_NAMES);
}

public function getSymfonyContainerPhp(): string
{
return $this->parameterProvider->provideStringParameter(Option::SYMFONY_CONTAINER_PHP_PATH_PARAMETER);
}
}

0 comments on commit fcadc67

Please sign in to comment.