Skip to content

Commit

Permalink
[BCB] Removed --paths-file CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 11, 2021
1 parent 4f5dacf commit 5670cf2
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 41 deletions.
4 changes: 0 additions & 4 deletions src/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ protected function configure(): void
->setDescription('Analyses source code')
->setDefinition([
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
new InputOption(self::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
new InputOption(ErrorsConsoleStyle::OPTION_NO_PROGRESS, null, InputOption::VALUE_NONE, 'Do not show progress bar, only results'),
Expand Down Expand Up @@ -91,7 +90,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$autoloadFile = $input->getOption('autoload-file');
$configuration = $input->getOption('configuration');
$level = $input->getOption(self::OPTION_LEVEL);
$pathsFile = $input->getOption('paths-file');
$allowXdebug = $input->getOption('xdebug');
$debugEnabled = (bool) $input->getOption('debug');
$fix = (bool) $input->getOption('fix') || (bool) $input->getOption('watch') || (bool) $input->getOption('pro');
Expand All @@ -110,7 +108,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|| (!is_string($autoloadFile) && $autoloadFile !== null)
|| (!is_string($configuration) && $configuration !== null)
|| (!is_string($level) && $level !== null)
|| (!is_string($pathsFile) && $pathsFile !== null)
|| (!is_bool($allowXdebug))
) {
throw new \PHPStan\ShouldNotHappenException();
Expand All @@ -121,7 +118,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$input,
$output,
$paths,
$pathsFile,
$memoryLimit,
$autoloadFile,
$this->composerAutoloaderProjectPaths,
Expand Down
1 change: 0 additions & 1 deletion src/Command/ClearResultCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output,
['.'],
null,
null,
$autoloadFile,
$this->composerAutoloaderProjectPaths,
$configuration,
Expand Down
25 changes: 0 additions & 25 deletions src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public static function begin(
InputInterface $input,
OutputInterface $output,
array $paths,
?string $pathsFile,
?string $memoryLimit,
?string $autoloadFile,
array $composerAutoloaderProjectPaths,
Expand Down Expand Up @@ -118,30 +117,6 @@ public static function begin(
return $currentWorkingDirectoryFileHelper->normalizePath($currentWorkingDirectoryFileHelper->absolutizePath($path));
}, $paths);

if (count($paths) === 0 && $pathsFile !== null) {
$pathsFile = $currentWorkingDirectoryFileHelper->absolutizePath($pathsFile);
if (!file_exists($pathsFile)) {
$errorOutput->writeLineFormatted(sprintf('Paths file %s does not exist.', $pathsFile));
throw new \PHPStan\Command\InceptionNotSuccessfulException();
}

try {
$pathsString = FileReader::read($pathsFile);
} catch (\PHPStan\File\CouldNotReadFileException $e) {
$errorOutput->writeLineFormatted($e->getMessage());
throw new \PHPStan\Command\InceptionNotSuccessfulException();
}

$paths = array_values(array_filter(explode("\n", $pathsString), static function (string $path): bool {
return trim($path) !== '';
}));

$pathsFileFileHelper = new FileHelper(dirname($pathsFile));
$paths = array_map(static function (string $path) use ($pathsFileFileHelper): string {
return $pathsFileFileHelper->normalizePath($pathsFileFileHelper->absolutizePath($path));
}, $paths);
}

$analysedPathsFromConfig = [];
$containerFactory = new ContainerFactory($currentWorkingDirectory);
$projectConfig = null;
Expand Down
4 changes: 0 additions & 4 deletions src/Command/FixerWorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected function configure(): void
->setDescription('(Internal) Support for PHPStan Pro.')
->setDefinition([
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
new InputOption(AnalyseCommand::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
Expand All @@ -59,7 +58,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$autoloadFile = $input->getOption('autoload-file');
$configuration = $input->getOption('configuration');
$level = $input->getOption(AnalyseCommand::OPTION_LEVEL);
$pathsFile = $input->getOption('paths-file');
$allowXdebug = $input->getOption('xdebug');
$allowParallel = $input->getOption('allow-parallel');

Expand All @@ -69,7 +67,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|| (!is_string($autoloadFile) && $autoloadFile !== null)
|| (!is_string($configuration) && $configuration !== null)
|| (!is_string($level) && $level !== null)
|| (!is_string($pathsFile) && $pathsFile !== null)
|| (!is_bool($allowXdebug))
|| (!is_bool($allowParallel))
) {
Expand Down Expand Up @@ -107,7 +104,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$input,
$output,
$paths,
$pathsFile,
$memoryLimit,
$autoloadFile,
$this->composerAutoloaderProjectPaths,
Expand Down
4 changes: 0 additions & 4 deletions src/Command/WorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protected function configure(): void
->setDescription('(Internal) Support for parallel analysis.')
->setDefinition([
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
new InputOption(AnalyseCommand::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
Expand All @@ -66,7 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$autoloadFile = $input->getOption('autoload-file');
$configuration = $input->getOption('configuration');
$level = $input->getOption(AnalyseCommand::OPTION_LEVEL);
$pathsFile = $input->getOption('paths-file');
$allowXdebug = $input->getOption('xdebug');
$port = $input->getOption('port');
$identifier = $input->getOption('identifier');
Expand All @@ -77,7 +75,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|| (!is_string($autoloadFile) && $autoloadFile !== null)
|| (!is_string($configuration) && $configuration !== null)
|| (!is_string($level) && $level !== null)
|| (!is_string($pathsFile) && $pathsFile !== null)
|| (!is_bool($allowXdebug))
|| !is_string($port)
|| !is_string($identifier)
Expand All @@ -101,7 +98,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$input,
$output,
$paths,
$pathsFile,
$memoryLimit,
$autoloadFile,
$this->composerAutoloaderProjectPaths,
Expand Down
1 change: 0 additions & 1 deletion src/Process/ProcessHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public static function getWorkerCommand(
}

$options = [
'paths-file',
AnalyseCommand::OPTION_LEVEL,
'autoload-file',
'memory-limit',
Expand Down
2 changes: 0 additions & 2 deletions tests/PHPStan/Command/CommandHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public function testBegin(
[__DIR__],
null,
null,
null,
[],
$projectConfigFile,
null,
Expand Down Expand Up @@ -304,7 +303,6 @@ public function testResolveParameters(
[__DIR__],
null,
null,
null,
[],
$configFile,
null,
Expand Down

0 comments on commit 5670cf2

Please sign in to comment.