Skip to content

Commit 5670cf2

Browse files
committed
[BCB] Removed --paths-file CLI option
1 parent 4f5dacf commit 5670cf2

File tree

7 files changed

+0
-41
lines changed

7 files changed

+0
-41
lines changed

src/Command/AnalyseCommand.php

-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ protected function configure(): void
4848
->setDescription('Analyses source code')
4949
->setDefinition([
5050
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
51-
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
5251
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
5352
new InputOption(self::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
5453
new InputOption(ErrorsConsoleStyle::OPTION_NO_PROGRESS, null, InputOption::VALUE_NONE, 'Do not show progress bar, only results'),
@@ -91,7 +90,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9190
$autoloadFile = $input->getOption('autoload-file');
9291
$configuration = $input->getOption('configuration');
9392
$level = $input->getOption(self::OPTION_LEVEL);
94-
$pathsFile = $input->getOption('paths-file');
9593
$allowXdebug = $input->getOption('xdebug');
9694
$debugEnabled = (bool) $input->getOption('debug');
9795
$fix = (bool) $input->getOption('fix') || (bool) $input->getOption('watch') || (bool) $input->getOption('pro');
@@ -110,7 +108,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
110108
|| (!is_string($autoloadFile) && $autoloadFile !== null)
111109
|| (!is_string($configuration) && $configuration !== null)
112110
|| (!is_string($level) && $level !== null)
113-
|| (!is_string($pathsFile) && $pathsFile !== null)
114111
|| (!is_bool($allowXdebug))
115112
) {
116113
throw new \PHPStan\ShouldNotHappenException();
@@ -121,7 +118,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
121118
$input,
122119
$output,
123120
$paths,
124-
$pathsFile,
125121
$memoryLimit,
126122
$autoloadFile,
127123
$this->composerAutoloaderProjectPaths,

src/Command/ClearResultCacheCommand.php

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5555
$output,
5656
['.'],
5757
null,
58-
null,
5958
$autoloadFile,
6059
$this->composerAutoloaderProjectPaths,
6160
$configuration,

src/Command/CommandHelper.php

-25
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public static function begin(
3737
InputInterface $input,
3838
OutputInterface $output,
3939
array $paths,
40-
?string $pathsFile,
4140
?string $memoryLimit,
4241
?string $autoloadFile,
4342
array $composerAutoloaderProjectPaths,
@@ -118,30 +117,6 @@ public static function begin(
118117
return $currentWorkingDirectoryFileHelper->normalizePath($currentWorkingDirectoryFileHelper->absolutizePath($path));
119118
}, $paths);
120119

121-
if (count($paths) === 0 && $pathsFile !== null) {
122-
$pathsFile = $currentWorkingDirectoryFileHelper->absolutizePath($pathsFile);
123-
if (!file_exists($pathsFile)) {
124-
$errorOutput->writeLineFormatted(sprintf('Paths file %s does not exist.', $pathsFile));
125-
throw new \PHPStan\Command\InceptionNotSuccessfulException();
126-
}
127-
128-
try {
129-
$pathsString = FileReader::read($pathsFile);
130-
} catch (\PHPStan\File\CouldNotReadFileException $e) {
131-
$errorOutput->writeLineFormatted($e->getMessage());
132-
throw new \PHPStan\Command\InceptionNotSuccessfulException();
133-
}
134-
135-
$paths = array_values(array_filter(explode("\n", $pathsString), static function (string $path): bool {
136-
return trim($path) !== '';
137-
}));
138-
139-
$pathsFileFileHelper = new FileHelper(dirname($pathsFile));
140-
$paths = array_map(static function (string $path) use ($pathsFileFileHelper): string {
141-
return $pathsFileFileHelper->normalizePath($pathsFileFileHelper->absolutizePath($path));
142-
}, $paths);
143-
}
144-
145120
$analysedPathsFromConfig = [];
146121
$containerFactory = new ContainerFactory($currentWorkingDirectory);
147122
$projectConfig = null;

src/Command/FixerWorkerCommand.php

-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ protected function configure(): void
3838
->setDescription('(Internal) Support for PHPStan Pro.')
3939
->setDefinition([
4040
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
41-
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
4241
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
4342
new InputOption(AnalyseCommand::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
4443
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
@@ -59,7 +58,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5958
$autoloadFile = $input->getOption('autoload-file');
6059
$configuration = $input->getOption('configuration');
6160
$level = $input->getOption(AnalyseCommand::OPTION_LEVEL);
62-
$pathsFile = $input->getOption('paths-file');
6361
$allowXdebug = $input->getOption('xdebug');
6462
$allowParallel = $input->getOption('allow-parallel');
6563

@@ -69,7 +67,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6967
|| (!is_string($autoloadFile) && $autoloadFile !== null)
7068
|| (!is_string($configuration) && $configuration !== null)
7169
|| (!is_string($level) && $level !== null)
72-
|| (!is_string($pathsFile) && $pathsFile !== null)
7370
|| (!is_bool($allowXdebug))
7471
|| (!is_bool($allowParallel))
7572
) {
@@ -107,7 +104,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107104
$input,
108105
$output,
109106
$paths,
110-
$pathsFile,
111107
$memoryLimit,
112108
$autoloadFile,
113109
$this->composerAutoloaderProjectPaths,

src/Command/WorkerCommand.php

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ protected function configure(): void
4646
->setDescription('(Internal) Support for parallel analysis.')
4747
->setDefinition([
4848
new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'),
49-
new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'),
5049
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
5150
new InputOption(AnalyseCommand::OPTION_LEVEL, 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'),
5251
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
@@ -66,7 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6665
$autoloadFile = $input->getOption('autoload-file');
6766
$configuration = $input->getOption('configuration');
6867
$level = $input->getOption(AnalyseCommand::OPTION_LEVEL);
69-
$pathsFile = $input->getOption('paths-file');
7068
$allowXdebug = $input->getOption('xdebug');
7169
$port = $input->getOption('port');
7270
$identifier = $input->getOption('identifier');
@@ -77,7 +75,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7775
|| (!is_string($autoloadFile) && $autoloadFile !== null)
7876
|| (!is_string($configuration) && $configuration !== null)
7977
|| (!is_string($level) && $level !== null)
80-
|| (!is_string($pathsFile) && $pathsFile !== null)
8178
|| (!is_bool($allowXdebug))
8279
|| !is_string($port)
8380
|| !is_string($identifier)
@@ -101,7 +98,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
10198
$input,
10299
$output,
103100
$paths,
104-
$pathsFile,
105101
$memoryLimit,
106102
$autoloadFile,
107103
$this->composerAutoloaderProjectPaths,

src/Process/ProcessHelper.php

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public static function getWorkerCommand(
4646
}
4747

4848
$options = [
49-
'paths-file',
5049
AnalyseCommand::OPTION_LEVEL,
5150
'autoload-file',
5251
'memory-limit',

tests/PHPStan/Command/CommandHelperTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ public function testBegin(
119119
[__DIR__],
120120
null,
121121
null,
122-
null,
123122
[],
124123
$projectConfigFile,
125124
null,
@@ -304,7 +303,6 @@ public function testResolveParameters(
304303
[__DIR__],
305304
null,
306305
null,
307-
null,
308306
[],
309307
$configFile,
310308
null,

0 commit comments

Comments
 (0)