chore: improves type checking

This commit is contained in:
Nuno Maduro
2023-02-20 17:33:03 +00:00
parent 09644640bf
commit d7ecef80e9

View File

@ -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);