Skip to content

Commit 873777a

Browse files
committed
Exit nonzero when the unexpected occurs
1 parent 72ca65f commit 873777a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

autoload.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616

1717
if (!isset($container) || !$container instanceof Container) {
1818
echo 'No container found, or container not of expected type' . PHP_EOL;
19-
return;
19+
die(-1);
2020
}
2121

2222
foreach ($container->getServicesByTag('phpstan.magento.autoloader') as $autoloader) {
23-
/** @var Autoloader $autoloader */
23+
/** @var Autoloader|object $autoloader */
24+
if (!$autoloader instanceof Autoloader) {
25+
echo 'Services tagged with \'phpstan.magento.autoloader\' must extend ' .
26+
'bitExpert\PHPStan\Magento\Autoload\Autoloader!' . PHP_EOL .
27+
get_class($autoloader) . ' does not.' . PHP_EOL;
28+
die(-1);
29+
}
30+
2431
$autoloader->register();
2532
}

0 commit comments

Comments
 (0)