1 | <?php |
||
15 | final class ResponseManager implements ResponseManagerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var ResponseFactoryInterface |
||
19 | */ |
||
20 | private $responseFactory; |
||
21 | |||
22 | /** |
||
23 | * @var SerializerInterface |
||
24 | */ |
||
25 | private $serializer; |
||
26 | |||
27 | /** |
||
28 | * @param ResponseFactoryInterface $responseFactory |
||
29 | * @param SerializerInterface $serializer |
||
30 | */ |
||
31 | 12 | public function __construct( |
|
38 | |||
39 | /** |
||
40 | * @param object $object |
||
41 | * @param string $accept |
||
42 | * @param int $status |
||
43 | * @param NormalizerContextInterface|null $context |
||
44 | * |
||
45 | * @return Response |
||
46 | */ |
||
47 | 8 | public function create( |
|
60 | |||
61 | /** |
||
62 | * @param string $accept |
||
63 | * @param int $status |
||
64 | * |
||
65 | * @return Response |
||
66 | */ |
||
67 | 2 | public function createEmpty(string $accept, int $status = 204): Response |
|
71 | |||
72 | /** |
||
73 | * @param string $location |
||
74 | * @param int $status |
||
75 | * |
||
76 | * @return Response |
||
77 | */ |
||
78 | 2 | public function createRedirect(string $location, int $status = 307): Response |
|
82 | |||
83 | /** |
||
84 | * @param ErrorInterface $error |
||
85 | * @param string $accept |
||
86 | * @param int $status |
||
87 | * @param NormalizerContextInterface|null $context |
||
88 | * |
||
89 | * @return Response |
||
90 | */ |
||
91 | 6 | public function createFromError( |
|
99 | |||
100 | /** |
||
101 | * @param string $accept |
||
102 | * @param NormalizerContextInterface|null $context |
||
103 | * |
||
104 | * @return Response |
||
105 | */ |
||
106 | 2 | public function createNotAuthenticated(string $accept, NormalizerContextInterface $context = null): Response |
|
115 | |||
116 | /** |
||
117 | * @param string $accept |
||
118 | * @param NormalizerContextInterface|null $context |
||
119 | * |
||
120 | * @return Response |
||
121 | */ |
||
122 | 2 | public function createNotAuthorized(string $accept, NormalizerContextInterface $context = null): Response |
|
131 | |||
132 | /** |
||
133 | * @param string $type |
||
134 | * @param array $arguments |
||
135 | * @param string $accept |
||
136 | * @param NormalizerContextInterface|null $context |
||
137 | * |
||
138 | * @return Response |
||
139 | */ |
||
140 | public function createResourceNotFound( |
||
154 | |||
155 | /** |
||
156 | * @param string $accept |
||
157 | * |
||
158 | * @return Response |
||
159 | */ |
||
160 | public function createAcceptNotSupported(string $accept): Response |
||
168 | |||
169 | /** |
||
170 | * @param string $contentType |
||
171 | * @param string $accept |
||
172 | * @param array $supportedContentTypes |
||
173 | * @param NormalizerContextInterface|null $context |
||
174 | * |
||
175 | * @return Response |
||
176 | */ |
||
177 | public function createContentTypeNotSupported( |
||
194 | } |
||
195 |