|
@@ -55,6 +55,7 @@ class FixCommand extends Command
|
|
|
->setDefinition(array(
|
|
|
new InputArgument('path', InputArgument::REQUIRED, 'The path'),
|
|
|
new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The configuration name', null),
|
|
|
+ new InputOption('config-file', '', InputOption::VALUE_OPTIONAL, 'The path to a .php_cs file ', null),
|
|
|
new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified'),
|
|
|
new InputOption('level', '', InputOption::VALUE_REQUIRED, 'The level of fixes (can be psr0, psr1, psr2, or all)', null),
|
|
|
new InputOption('fixers', '', InputOption::VALUE_REQUIRED, 'A list of fixers to run'),
|
|
@@ -148,6 +149,9 @@ Note the additional <comment>-</comment> in front of the Fixer name.
|
|
|
->fixers(array('-Psr0Fixer'))
|
|
|
->finder(\$finder)
|
|
|
;
|
|
|
+
|
|
|
+With the <comment>--config-file</comment> option you can specify the path to the
|
|
|
+<comment>.php_cs</comment> file.
|
|
|
EOF
|
|
|
);
|
|
|
}
|
|
@@ -187,6 +191,9 @@ EOF
|
|
|
if (null === $config) {
|
|
|
throw new \InvalidArgumentException(sprintf('The configuration "%s" is not defined', $input->getOption('config')));
|
|
|
}
|
|
|
+ } elseif ($input->getOption('config-file')) {
|
|
|
+ $file = $input->getOption('config-file');
|
|
|
+ $config = include $file;
|
|
|
} elseif (file_exists($file = $path.'/.php_cs')) {
|
|
|
$config = include $file;
|
|
|
$addSuppliedPathFromCli = false;
|