Skip to content

Commit

Permalink
Fixed scenario with zero analysed files
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 4, 2023
1 parent 2556918 commit 6debffd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}

if (count($files) === 0) {
$inceptionResult->getErrorOutput()->getStyle()->note('No files found to analyse.');
$inceptionResult->getErrorOutput()->getStyle()->warning('This will cause a non-zero exit code in PHPStan 2.0.');

return $inceptionResult->handleReturn(0, null);
}

/** @var AnalyseApplication $application */
$application = $container->getByType(AnalyseApplication::class);

Expand Down

0 comments on commit 6debffd

Please sign in to comment.