1 | <?php |
||
19 | class ResponseRenderer |
||
20 | { |
||
21 | /** |
||
22 | * @var Manager |
||
23 | */ |
||
24 | private $fractalManager; |
||
25 | |||
26 | /** |
||
27 | * @var TransformerAbstract |
||
28 | */ |
||
29 | private $transformer; |
||
30 | |||
31 | /** |
||
32 | * @param Manager $fractalManager |
||
33 | * @param TransformerAbstract $transformer |
||
34 | */ |
||
35 | public function __construct( |
||
42 | |||
43 | /** |
||
44 | * @param mixed $data |
||
45 | * @param int $httpCode |
||
46 | * @param string|null $resourceKey |
||
47 | * |
||
48 | * @return Response |
||
49 | * |
||
50 | * @throws \InvalidArgumentException |
||
51 | * @throws UnsupportedObjectException |
||
52 | */ |
||
53 | public function renderResponse($data, int $httpCode, string $resourceKey = null): Response |
||
62 | |||
63 | /** |
||
64 | * @param mixed $data |
||
65 | * @param string|null $resourceKey |
||
66 | * |
||
67 | * @return ResourceInterface |
||
68 | */ |
||
69 | private function createResource($data, string $resourceKey = null): ResourceInterface |
||
81 | } |
||
82 |