1 | <?php |
||
24 | class Environment implements EnvironmentInterface |
||
25 | { |
||
26 | /** |
||
27 | * Expected query parameters type |
||
28 | * |
||
29 | * @var string|null |
||
30 | */ |
||
31 | protected $queryType; |
||
32 | |||
33 | /** |
||
34 | * Expected body content type |
||
35 | * |
||
36 | * @var string|null |
||
37 | */ |
||
38 | protected $bodyType; |
||
39 | |||
40 | /** |
||
41 | * Codec matcher configuration |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $matcherConfiguration; |
||
46 | |||
47 | /** |
||
48 | * URLs prefix |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $urlPrefix = ''; |
||
53 | |||
54 | /** |
||
55 | * Validation groups |
||
56 | * |
||
57 | * @var string[]|null |
||
58 | */ |
||
59 | protected $validationGroups; |
||
60 | |||
61 | /** |
||
62 | * Response encoder |
||
63 | * |
||
64 | * @var EncoderInterface|null |
||
65 | */ |
||
66 | protected $encoder; |
||
67 | |||
68 | /** |
||
69 | * Response encoder media type |
||
70 | * |
||
71 | * @var MediaTypeInterface|null |
||
72 | */ |
||
73 | protected $encoderMediaType; |
||
74 | |||
75 | /** |
||
76 | * Constructor |
||
77 | * |
||
78 | * @param array|null $config |
||
79 | */ |
||
80 | 2 | public function __construct(array $config = null) |
|
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | 1 | public function getQueryType() |
|
94 | |||
95 | /** |
||
96 | * Sets expected query parameters type |
||
97 | * |
||
98 | * @param null|string $queryType |
||
99 | * @return $this |
||
100 | */ |
||
101 | 1 | public function setQueryType($queryType = null) |
|
107 | |||
108 | /** |
||
109 | * @inheritdoc |
||
110 | */ |
||
111 | 1 | public function getBodyType() |
|
115 | |||
116 | /** |
||
117 | * Sets expected body content type |
||
118 | * |
||
119 | * @param null|string $bodyType |
||
120 | * @return $this |
||
121 | */ |
||
122 | 1 | public function setBodyType($bodyType = null) |
|
128 | |||
129 | /** |
||
130 | * @inheritdoc |
||
131 | */ |
||
132 | 1 | public function getMatcherConfiguration() |
|
136 | |||
137 | /** |
||
138 | * Sets codec matcher configuration |
||
139 | * |
||
140 | * @param array $matcherConfiguration |
||
141 | * @return $this |
||
142 | */ |
||
143 | 2 | public function setMatcherConfiguration(array $matcherConfiguration) |
|
149 | |||
150 | /** |
||
151 | * @inheritdoc |
||
152 | */ |
||
153 | 1 | public function getUrlPrefix() |
|
157 | |||
158 | /** |
||
159 | * Sets URLs prefix |
||
160 | * |
||
161 | * @param string $urlPrefix |
||
162 | * @return $this |
||
163 | */ |
||
164 | 1 | public function setUrlPrefix($urlPrefix) |
|
170 | |||
171 | /** |
||
172 | * @inheritdoc |
||
173 | */ |
||
174 | 1 | public function getValidationGroups() |
|
178 | |||
179 | /** |
||
180 | * Sets validation groups |
||
181 | * |
||
182 | * @param array|null $validationGroups |
||
183 | * @return $this |
||
184 | */ |
||
185 | 2 | public function setValidationGroups(array $validationGroups = null) |
|
191 | |||
192 | /** |
||
193 | * @inheritdoc |
||
194 | */ |
||
195 | public function getEncoder() |
||
199 | |||
200 | /** |
||
201 | * Sets response encoder |
||
202 | * |
||
203 | * @param EncoderInterface $encoder |
||
204 | * @return $this |
||
205 | */ |
||
206 | public function setEncoder(EncoderInterface $encoder) |
||
212 | |||
213 | /** |
||
214 | * @inheritdoc |
||
215 | */ |
||
216 | public function getEncoderMediaType() |
||
220 | |||
221 | /** |
||
222 | * Sets response encoder media type |
||
223 | * |
||
224 | * @param MediaTypeInterface $encoderMediaType |
||
225 | * @return $this |
||
226 | */ |
||
227 | public function setEncoderMediaType(MediaTypeInterface $encoderMediaType) |
||
233 | |||
234 | /** |
||
235 | * Sets environment configuration from array |
||
236 | * |
||
237 | * @param array $config |
||
238 | */ |
||
239 | 2 | protected function fromArray(array $config) |
|
257 | } |
||
258 |