diff --git a/src/Panic.php b/src/Panic.php index 4b198c7c..6d6ae1f8 100644 --- a/src/Panic.php +++ b/src/Panic.php @@ -39,13 +39,14 @@ final class Panic */ private function handle(): void { - /** @var OutputInterface $output */ try { $output = Container::getInstance()->get(OutputInterface::class); - } catch (Throwable) { + } catch (Throwable) { // @phpstan-ignore-line $output = new ConsoleOutput(); } + assert($output instanceof OutputInterface); + if ($this->throwable instanceof Contracts\Panicable) { $this->throwable->render($output);