1 | <?php |
||
15 | class UserShowJsonResponder |
||
16 | { |
||
17 | /** |
||
18 | * @var ResponseFactoryInterface |
||
19 | */ |
||
20 | private $responseFactory; |
||
21 | |||
22 | /** |
||
23 | * @var StreamFactoryInterface |
||
24 | */ |
||
25 | private $streamFactory; |
||
26 | |||
27 | 1 | public function __construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory) |
|
32 | |||
33 | /** |
||
34 | * @param User|null $user |
||
35 | * @return ResponseInterface |
||
36 | */ |
||
37 | 1 | public function respond(User $user = null): ResponseInterface |
|
50 | |||
51 | /** |
||
52 | * @param array|\JsonSerializable $body |
||
53 | * @param int $status |
||
54 | * @return ResponseInterface |
||
55 | */ |
||
56 | 1 | private function createJsonResponse($body, int $status): ResponseInterface |
|
63 | } |
||
64 |