@@ -107,7 +107,7 @@ protected function configure(): void
107
107
new InputOption ('watch ' , null , InputOption::VALUE_NONE , 'Launch PHPStan Pro ' ),
108
108
new InputOption ('pro ' , null , InputOption::VALUE_NONE , 'Launch PHPStan Pro ' ),
109
109
new InputOption ('fail-without-result-cache ' , null , InputOption::VALUE_NONE , 'Return non-zero exit code when result cache is not used ' ),
110
- new InputOption ('ignore-new -errors ' , null , InputOption::VALUE_NONE , 'Ignore new errors when generating the baseline. ' ),
110
+ new InputOption ('only-remove -errors ' , null , InputOption::VALUE_NONE , 'Only remove existing errors from the baseline. Do not add new ones . ' ),
111
111
]);
112
112
}
113
113
@@ -142,7 +142,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
142
142
$ debugEnabled = (bool ) $ input ->getOption ('debug ' );
143
143
$ fix = (bool ) $ input ->getOption ('fix ' ) || (bool ) $ input ->getOption ('watch ' ) || (bool ) $ input ->getOption ('pro ' );
144
144
$ failWithoutResultCache = (bool ) $ input ->getOption ('fail-without-result-cache ' );
145
- $ ignoreNewErrors = (bool ) $ input ->getOption ('ignore-new -errors ' );
145
+ $ onlyRemoveErrors = (bool ) $ input ->getOption ('only-remove -errors ' );
146
146
147
147
/** @var string|false|null $generateBaselineFile */
148
148
$ generateBaselineFile = $ input ->getOption ('generate-baseline ' );
@@ -189,8 +189,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
189
189
return $ inceptionResult ->handleReturn (1 , null , $ this ->analysisStartTime );
190
190
}
191
191
192
- if ($ generateBaselineFile === null && $ ignoreNewErrors ) {
193
- $ inceptionResult ->getStdOutput ()->getStyle ()->error ('You must pass the --generate-baseline option alongside --ignore-new -errors. ' );
192
+ if ($ generateBaselineFile === null && $ onlyRemoveErrors ) {
193
+ $ inceptionResult ->getStdOutput ()->getStyle ()->error ('You must pass the --generate-baseline option alongside --only-remove -errors. ' );
194
194
return $ inceptionResult ->handleReturn (1 , null , $ this ->analysisStartTime );
195
195
}
196
196
@@ -423,7 +423,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
423
423
return $ inceptionResult ->handleReturn (1 , $ analysisResult ->getPeakMemoryUsageBytes (), $ this ->analysisStartTime );
424
424
}
425
425
426
- return $ this ->generateBaseline ($ generateBaselineFile , $ inceptionResult , $ analysisResult , $ output , $ allowEmptyBaseline , $ baselineExtension , $ failWithoutResultCache , $ ignoreNewErrors , $ container );
426
+ return $ this ->generateBaseline ($ generateBaselineFile , $ inceptionResult , $ analysisResult , $ output , $ allowEmptyBaseline , $ baselineExtension , $ failWithoutResultCache , $ onlyRemoveErrors , $ container );
427
427
}
428
428
429
429
/** @var ErrorFormatter $errorFormatter */
@@ -599,12 +599,12 @@ private function getMessageFromInternalError(FileHelper $fileHelper, InternalErr
599
599
return $ message ;
600
600
}
601
601
602
- private function generateBaseline (string $ generateBaselineFile , InceptionResult $ inceptionResult , AnalysisResult $ analysisResult , OutputInterface $ output , bool $ allowEmptyBaseline , string $ baselineExtension , bool $ failWithoutResultCache , bool $ ignoreNewErrors , Container $ container ): int
602
+ private function generateBaseline (string $ generateBaselineFile , InceptionResult $ inceptionResult , AnalysisResult $ analysisResult , OutputInterface $ output , bool $ allowEmptyBaseline , string $ baselineExtension , bool $ failWithoutResultCache , bool $ onlyRemoveErrors , Container $ container ): int
603
603
{
604
604
$ baselineFileDirectory = dirname ($ generateBaselineFile );
605
605
$ fileHelper = $ container ->getByType (FileHelper::class);
606
606
$ baselinePathHelper = new ParentDirectoryRelativePathHelper ($ baselineFileDirectory );
607
- if ($ ignoreNewErrors ) {
607
+ if ($ onlyRemoveErrors ) {
608
608
$ analysisResult = $ this ->filterAnalysisResultForExistingErrors ($ analysisResult , $ generateBaselineFile , $ inceptionResult , $ fileHelper , $ baselinePathHelper );
609
609
}
610
610
0 commit comments