1 | <?php |
||
15 | final class ResponseManager implements ResponseManagerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var DeserializerInterface |
||
19 | */ |
||
20 | private $deserializer; |
||
21 | |||
22 | /** |
||
23 | * @var ResponseFactoryInterface |
||
24 | */ |
||
25 | private $responseFactory; |
||
26 | |||
27 | /** |
||
28 | * @var SerializerInterface |
||
29 | */ |
||
30 | private $serializer; |
||
31 | |||
32 | /** |
||
33 | * @param DeserializerInterface $deserializer |
||
34 | * @param ResponseFactoryInterface $responseFactory |
||
35 | * @param SerializerInterface $serializer |
||
36 | */ |
||
37 | 14 | public function __construct( |
|
46 | |||
47 | /** |
||
48 | * @param object $object |
||
49 | * @param string $accept |
||
50 | * @param int $status |
||
51 | * @param NormalizerContextInterface|null $context |
||
52 | * |
||
53 | * @return Response |
||
54 | */ |
||
55 | 10 | public function create( |
|
68 | |||
69 | /** |
||
70 | * @param string $accept |
||
71 | * @param int $status |
||
72 | * |
||
73 | * @return Response |
||
74 | */ |
||
75 | 2 | public function createEmpty(string $accept, int $status = 204): Response |
|
79 | |||
80 | /** |
||
81 | * @param string $location |
||
82 | * @param int $status |
||
83 | * |
||
84 | * @return Response |
||
85 | */ |
||
86 | 2 | public function createRedirect(string $location, int $status = 307): Response |
|
90 | |||
91 | /** |
||
92 | * @param ErrorInterface $error |
||
93 | * @param string $accept |
||
94 | * @param int $status |
||
95 | * @param NormalizerContextInterface|null $context |
||
96 | * |
||
97 | * @return Response |
||
98 | */ |
||
99 | 8 | public function createFromError( |
|
107 | |||
108 | /** |
||
109 | * @param string $accept |
||
110 | * @param NormalizerContextInterface|null $context |
||
111 | * |
||
112 | * @return Response |
||
113 | */ |
||
114 | 2 | public function createNotAuthenticated(string $accept, NormalizerContextInterface $context = null): Response |
|
123 | |||
124 | /** |
||
125 | * @param string $accept |
||
126 | * @param NormalizerContextInterface|null $context |
||
127 | * |
||
128 | * @return Response |
||
129 | */ |
||
130 | 2 | public function createNotAuthorized(string $accept, NormalizerContextInterface $context = null): Response |
|
139 | |||
140 | /** |
||
141 | * @param string $reference |
||
142 | * @param array $arguments |
||
143 | * @param string $accept |
||
144 | * @param NormalizerContextInterface|null $context |
||
145 | * |
||
146 | * @return Response |
||
147 | */ |
||
148 | 2 | public function createResourceNotFound( |
|
162 | |||
163 | /** |
||
164 | * @param string $accept |
||
165 | * |
||
166 | * @return Response |
||
167 | */ |
||
168 | public function createAcceptNotSupported(string $accept): Response |
||
176 | |||
177 | /** |
||
178 | * @param string $contentType |
||
179 | * @param string $accept |
||
180 | * @param NormalizerContextInterface|null $context |
||
181 | * |
||
182 | * @return Response |
||
183 | */ |
||
184 | public function createContentTypeNotSupported( |
||
200 | } |
||
201 |