File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace HttpSoft \Tests \Basis \TestAsset ;
6+
7+ use HttpSoft \Basis \Exception \HttpException ;
8+ use Psr \Http \Message \ResponseInterface ;
9+ use Psr \Http \Message \ServerRequestInterface ;
10+ use Psr \Http \Server \MiddlewareInterface ;
11+ use Psr \Http \Server \RequestHandlerInterface ;
12+
13+ class ErrorMiddleware implements MiddlewareInterface
14+ {
15+ /**
16+ * @var HttpException
17+ */
18+ private HttpException $ exception ;
19+
20+ /**
21+ * @param HttpException $exception
22+ */
23+ public function __construct (HttpException $ exception )
24+ {
25+ $ this ->exception = $ exception ;
26+ }
27+
28+ /**
29+ * @param ServerRequestInterface $request
30+ * @param RequestHandlerInterface $handler
31+ * @return ResponseInterface
32+ * @throws HttpException
33+ */
34+ public function process (ServerRequestInterface $ request , RequestHandlerInterface $ handler ): ResponseInterface
35+ {
36+ throw $ this ->exception ;
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments