alecgunnar/Maverick

View on GitHub
src/Handler/Whoops/HttpExceptionWhoopsHandler.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Maverick\Handler\Whoops;

use Whoops\Handler\Handler;
use Maverick\Http\Exception\HttpExceptionInterface;

class HttpExceptionWhoopsHandler extends Handler
{
    public function handle()
    {
        $exception = $this->getException();

        if ($exception instanceof HttpExceptionInterface) {
            $this->getRun()->sendHttpCode(
                $exception->getStatusCode()
            );
        }
    }
}