From d7ecef80e98749bbf392d08c0dcfee4277b0d48b Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 20 Feb 2023 17:33:03 +0000 Subject: [PATCH] chore: improves type checking --- src/Panic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);