1 | <?php |
||
18 | class EmptyResponseHandler implements RequestHandlerInterface{ |
||
19 | |||
20 | /** |
||
21 | * @var \Psr\Http\Message\ResponseFactoryInterface |
||
22 | */ |
||
23 | protected ResponseFactoryInterface $responseFactory; |
||
|
|||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | protected int $status; |
||
29 | |||
30 | /** |
||
31 | * EmptyResponseHandler constructor. |
||
32 | * |
||
33 | * @param \Psr\Http\Message\ResponseFactoryInterface $responseFactory |
||
34 | * @param int $status |
||
35 | */ |
||
36 | public function __construct(ResponseFactoryInterface $responseFactory, int $status){ |
||
37 | $this->responseFactory = $responseFactory; |
||
38 | $this->status = $status; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @inheritDoc |
||
43 | */ |
||
44 | public function handle(ServerRequestInterface $request):ResponseInterface{ |
||
45 | return $this->responseFactory->createResponse($this->status); |
||
46 | } |
||
47 | |||
48 | } |
||
49 |