engelsystem/tests/Unit/Middleware/Stub/ExceptionMiddlewareHandler.php

24 lines
560 B
PHP
Raw Permalink Normal View History

2018-08-11 23:46:28 +02:00
<?php
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
*
* @param ServerRequestInterface $request
* @return ResponseInterface
* @throws Exception
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
throw new Exception('Boooom!');
}
}