From dd028cb4ccc44c6aa12b51f443e8761d5d4efc1d Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sat, 1 Jun 2024 13:47:23 +0200 Subject: [PATCH] Detect `--generate-baseline` combined with `--pro` --- src/Command/AnalyseCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Command/AnalyseCommand.php b/src/Command/AnalyseCommand.php index 45d3393880..513a9b8697 100644 --- a/src/Command/AnalyseCommand.php +++ b/src/Command/AnalyseCommand.php @@ -264,6 +264,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if ($fix) { + if ($generateBaselineFile !== null) { + $inceptionResult->getStdOutput()->getStyle()->error('You cannot pass the --generate-baseline option when running PHPStan Pro.'); + return $inceptionResult->handleReturn(1, null); + } + return $this->runFixer($inceptionResult, $container, $onlyFiles, $input, $output, $files); }