zeuxisoo / php-slim-whoops

PHP whoops error on slim framework
132 stars 10 forks source link

Fixed crash when guard is disabled #27

Closed mhilker closed 4 years ago

mhilker commented 4 years ago

When the guard is disabled with the enable option it crashes with a type error.

$app->add(new WhoopsMiddleware([
    'enable' => false,
]));
Return value of Zeuxisoo\Whoops\Slim\WhoopsGuard::install() must be an instance of Whoops\Run, none returned File: /app/vendor/zeuxisoo/slim-whoops/src/Zeuxisoo/Whoops/Slim/WhoopsGuard.php Line: 112

I've added an early return and made the return value nullable.