2018-08-11 23:46:28 +02:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-08-11 23:46:28 +02:00
|
|
|
namespace Engelsystem\Test\Unit\Middleware\Stub;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
|
use Psr\Http\Server\RequestHandlerInterface;
|
|
|
|
|
|
|
|
class ExceptionMiddlewareHandler implements RequestHandlerInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Throws an exception
|
|
|
|
*
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public function handle(ServerRequestInterface $request): ResponseInterface
|
|
|
|
{
|
|
|
|
throw new Exception('Boooom!');
|
|
|
|
}
|
|
|
|
}
|