Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move default file name to the ConfigurationFactory #621

Merged
merged 1 commit into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

final class ConfigurationFactory
{
public const DEFAULT_FILE_NAME = 'scoper.inc.php';

private Filesystem $fileSystem;
private SymbolsConfigurationFactory $configurationWhitelistFactory;

Expand Down
5 changes: 2 additions & 3 deletions src/Console/Command/AddPrefixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ final class AddPrefixCommand implements Command, CommandAware
private const FORCE_OPT = 'force';
private const STOP_ON_FAILURE_OPT = 'stop-on-failure';
private const CONFIG_FILE_OPT = 'config';
private const DEFAULT_CONFIG_FILE_PATH = 'scoper.inc.php';
private const NO_CONFIG_OPT = 'no-config';

private Filesystem $fileSystem;
Expand Down Expand Up @@ -117,7 +116,7 @@ public function getConfiguration(): CommandConfiguration
InputOption::VALUE_REQUIRED,
sprintf(
'Conf,iguration file. Will use "%s" if found by default.',
self::DEFAULT_CONFIG_FILE_PATH
ConfigurationFactory::DEFAULT_FILE_NAME,
)
),
new InputOption(
Expand Down Expand Up @@ -211,7 +210,7 @@ private function retrieveConfig(IO $io, array $paths): Configuration
$io->getStringOption(self::PREFIX_OPT),
$io->getBooleanOption(self::NO_CONFIG_OPT),
$io->getNullableStringOption(self::CONFIG_FILE_OPT),
self::DEFAULT_CONFIG_FILE_PATH,
ConfigurationFactory::DEFAULT_FILE_NAME,
$this->init,
$paths,
getcwd(),
Expand Down