Skip to content

Commit

Permalink
Do not allow to generate baseline when reflection error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 4, 2024
1 parent cb6cd3c commit 78ea9a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return $inceptionResult->handleReturn(1, $analysisResult->getPeakMemoryUsageBytes());
}

foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
if (!$fileSpecificError->hasNonIgnorableException()) {
continue;
}

$inceptionResult->getStdOutput()->getStyle()->error('An internal error occurred. Baseline could not be generated.');

$inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getMessage());
$inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getFile());
$inceptionResult->getStdOutput()->writeLineFormatted('');

return $inceptionResult->handleReturn(1, $analysisResult->getPeakMemoryUsageBytes());
}

$streamOutput = $this->createStreamOutput();
$errorConsoleStyle = new ErrorsConsoleStyle(new StringInput(''), $streamOutput);
$baselineOutput = new SymfonyOutput($streamOutput, new SymfonyStyle($errorConsoleStyle));
Expand Down

0 comments on commit 78ea9a6

Please sign in to comment.