Skip to content

Commit d779d1a

Browse files
lookymanondrejmirtes
authored andcommitted
Better error for invalid consoleApplicationLoader setting
1 parent 5e9fc30 commit d779d1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/Symfony/ConsoleApplicationResolver.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use function file_exists;
1010
use function get_class;
1111
use function is_readable;
12+
use function sprintf;
1213

1314
final class ConsoleApplicationResolver
1415
{
@@ -34,7 +35,7 @@ private function loadConsoleApplication(string $consoleApplicationLoader)
3435
if (!file_exists($consoleApplicationLoader)
3536
|| !is_readable($consoleApplicationLoader)
3637
) {
37-
throw new ShouldNotHappenException();
38+
throw new ShouldNotHappenException(sprintf('Cannot load console application. Check the parameters.symfony.consoleApplicationLoader setting in PHPStan\'s config. The offending value is "%s".', $consoleApplicationLoader));
3839
}
3940

4041
return require $consoleApplicationLoader;

0 commit comments

Comments
 (0)