1 | <?php |
||||
2 | |||||
3 | /** |
||||
4 | * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
||||
5 | * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
||||
6 | */ |
||||
7 | |||||
8 | namespace Spryker\Glue\GlueApplication; |
||||
9 | |||||
10 | use Spryker\Glue\GlueApplication\ApiApplication\ApiApplicationBootstrapResolver; |
||||
11 | use Spryker\Glue\GlueApplication\ApiApplication\ApiApplicationBootstrapResolverInterface; |
||||
12 | use Spryker\Glue\GlueApplication\ApiApplication\ApiApplicationProxy; |
||||
13 | use Spryker\Glue\GlueApplication\ApiApplication\GlueStorefrontFallbackApiApplication; |
||||
14 | use Spryker\Glue\GlueApplication\ApiApplication\RequestFlowExecutor; |
||||
15 | use Spryker\Glue\GlueApplication\ApiApplication\RequestFlowExecutorInterface; |
||||
16 | use Spryker\Glue\GlueApplication\Builder\Request\AttributesRequestBuilder; |
||||
17 | use Spryker\Glue\GlueApplication\Builder\Request\FilterFieldRequestBuilder; |
||||
18 | use Spryker\Glue\GlueApplication\Builder\Request\PaginationParameterRequestBuilder; |
||||
19 | use Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface; |
||||
20 | use Spryker\Glue\GlueApplication\Builder\Request\SortParameterRequestBuilder; |
||||
21 | use Spryker\Glue\GlueApplication\Builder\Request\SparseFieldRequestBuilder; |
||||
22 | use Spryker\Glue\GlueApplication\Builder\RequestBuilder as RequestBuilderWrapper; |
||||
23 | use Spryker\Glue\GlueApplication\Builder\RequestBuilderInterface as RequestBuilderWrapperInterface; |
||||
24 | use Spryker\Glue\GlueApplication\Cache\Reader\ControllerCacheReader; |
||||
25 | use Spryker\Glue\GlueApplication\Cache\Reader\ControllerCacheReaderInterface; |
||||
26 | use Spryker\Glue\GlueApplication\Cache\Writer\ControllerCacheWriter; |
||||
27 | use Spryker\Glue\GlueApplication\Cache\Writer\ControllerCacheWriterInterface; |
||||
28 | use Spryker\Glue\GlueApplication\ContentNegotiator\ContentNegotiator; |
||||
29 | use Spryker\Glue\GlueApplication\ContentNegotiator\ContentNegotiatorInterface; |
||||
30 | use Spryker\Glue\GlueApplication\Dependency\Client\GlueApplicationToStoreClientInterface; |
||||
31 | use Spryker\Glue\GlueApplication\Dependency\External\GlueApplicationToInflectorInterface; |
||||
32 | use Spryker\Glue\GlueApplication\Dependency\External\GlueApplicationToSymfonyFilesystemInterface; |
||||
33 | use Spryker\Glue\GlueApplication\Dependency\Service\GlueApplicationToLocaleServiceInterface; |
||||
34 | use Spryker\Glue\GlueApplication\Dependency\Service\GlueApplicationToUtilEncodingServiceInterface; |
||||
35 | use Spryker\Glue\GlueApplication\Descriptor\TextDescriptor; |
||||
36 | use Spryker\Glue\GlueApplication\Encoder\Response\JsonResponseEncoderStrategy; |
||||
37 | use Spryker\Glue\GlueApplication\Encoder\Response\ResponseEncoderStrategyInterface; |
||||
38 | use Spryker\Glue\GlueApplication\Executor\ResourceExecutor; |
||||
39 | use Spryker\Glue\GlueApplication\Executor\ResourceExecutorInterface; |
||||
40 | use Spryker\Glue\GlueApplication\Formatter\Response\ResponseFormatter as DefaultConventionResponseFormatter; |
||||
41 | use Spryker\Glue\GlueApplication\Formatter\Response\ResponseFormatterInterface as DefaultConventionResponseFormatterInterface; |
||||
42 | use Spryker\Glue\GlueApplication\Formatter\ResponseFormatter; |
||||
43 | use Spryker\Glue\GlueApplication\Formatter\ResponseFormatterInterface; |
||||
44 | use Spryker\Glue\GlueApplication\Formatter\Schema\RestApiSchemaFormatter; |
||||
45 | use Spryker\Glue\GlueApplication\Formatter\Schema\RestApiSchemaParametersFormatter; |
||||
46 | use Spryker\Glue\GlueApplication\Formatter\Schema\RestApiSchemaParametersFormatterInterface; |
||||
47 | use Spryker\Glue\GlueApplication\Formatter\Schema\SchemaFormatterInterface; |
||||
48 | use Spryker\Glue\GlueApplication\Http\Context\ContextHttpExpander; |
||||
49 | use Spryker\Glue\GlueApplication\Http\Context\ContextHttpExpanderInterface; |
||||
50 | use Spryker\Glue\GlueApplication\Http\Request\RequestBuilder as HttpRequestBuilder; |
||||
51 | use Spryker\Glue\GlueApplication\Http\Request\RequestBuilderInterface as HttpRequestBuilderInterface; |
||||
52 | use Spryker\Glue\GlueApplication\Http\Response\HttpSender; |
||||
53 | use Spryker\Glue\GlueApplication\Http\Response\HttpSenderInterface; |
||||
54 | use Spryker\Glue\GlueApplication\Plugin\Console\Helper\DescriptorHelper; |
||||
55 | use Spryker\Glue\GlueApplication\Plugin\Rest\GlueControllerListenerPlugin; |
||||
56 | use Spryker\Glue\GlueApplication\Rest\ContentType\ContentTypeResolver; |
||||
57 | use Spryker\Glue\GlueApplication\Rest\ContentType\ContentTypeResolverInterface; |
||||
58 | use Spryker\Glue\GlueApplication\Rest\ControllerCallbacks; |
||||
59 | use Spryker\Glue\GlueApplication\Rest\ControllerCallbacksInterface; |
||||
60 | use Spryker\Glue\GlueApplication\Rest\ControllerFilter; |
||||
61 | use Spryker\Glue\GlueApplication\Rest\ControllerFilterInterface; |
||||
62 | use Spryker\Glue\GlueApplication\Rest\Cors\CorsResponse; |
||||
63 | use Spryker\Glue\GlueApplication\Rest\Cors\CorsResponseInterface; |
||||
64 | use Spryker\Glue\GlueApplication\Rest\JsonApi\RestResourceBuilder; |
||||
65 | use Spryker\Glue\GlueApplication\Rest\JsonApi\RestResourceBuilderInterface; |
||||
66 | use Spryker\Glue\GlueApplication\Rest\Language\LanguageNegotiation; |
||||
67 | use Spryker\Glue\GlueApplication\Rest\Language\LanguageNegotiationInterface; |
||||
68 | use Spryker\Glue\GlueApplication\Rest\Request\CorsHttpRequestValidator; |
||||
69 | use Spryker\Glue\GlueApplication\Rest\Request\CorsHttpRequestValidatorInterface; |
||||
70 | use Spryker\Glue\GlueApplication\Rest\Request\FormattedControllerBeforeAction; |
||||
71 | use Spryker\Glue\GlueApplication\Rest\Request\FormattedControllerBeforeActionInterface; |
||||
72 | use Spryker\Glue\GlueApplication\Rest\Request\HeadersHttpRequestValidator; |
||||
73 | use Spryker\Glue\GlueApplication\Rest\Request\HeadersHttpRequestValidatorInterface; |
||||
74 | use Spryker\Glue\GlueApplication\Rest\Request\HttpRequestValidator; |
||||
75 | use Spryker\Glue\GlueApplication\Rest\Request\HttpRequestValidatorInterface; |
||||
76 | use Spryker\Glue\GlueApplication\Rest\Request\PaginationParametersHttpRequestValidator; |
||||
77 | use Spryker\Glue\GlueApplication\Rest\Request\PaginationParametersHttpRequestValidatorInterface; |
||||
78 | use Spryker\Glue\GlueApplication\Rest\Request\RequestFormatter; |
||||
79 | use Spryker\Glue\GlueApplication\Rest\Request\RequestFormatterInterface; |
||||
80 | use Spryker\Glue\GlueApplication\Rest\Request\RequestMetaDataExtractor; |
||||
81 | use Spryker\Glue\GlueApplication\Rest\Request\RequestMetaDataExtractorInterface; |
||||
82 | use Spryker\Glue\GlueApplication\Rest\Request\RequestResourceExtractor; |
||||
83 | use Spryker\Glue\GlueApplication\Rest\Request\RequestResourceExtractorInterface; |
||||
84 | use Spryker\Glue\GlueApplication\Rest\Request\RestRequestValidator; |
||||
85 | use Spryker\Glue\GlueApplication\Rest\Request\RestRequestValidatorInterface; |
||||
86 | use Spryker\Glue\GlueApplication\Rest\ResourceRelationshipLoader; |
||||
87 | use Spryker\Glue\GlueApplication\Rest\ResourceRelationshipLoaderInterface; |
||||
88 | use Spryker\Glue\GlueApplication\Rest\ResourceRouteLoader; |
||||
89 | use Spryker\Glue\GlueApplication\Rest\ResourceRouteLoaderInterface; |
||||
90 | use Spryker\Glue\GlueApplication\Rest\ResourceRouter as RestResourceRouter; |
||||
91 | use Spryker\Glue\GlueApplication\Rest\ResourceRouterInterface as RestResourceRouterInterface; |
||||
92 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseBuilder; |
||||
93 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseBuilderInterface; |
||||
94 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseFormatter as RestResponseFormatter; |
||||
95 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseFormatterInterface as RestResponseFormatterInterface; |
||||
96 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseHeaders; |
||||
97 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseHeadersInterface; |
||||
98 | use Spryker\Glue\GlueApplication\Rest\Response\ResponsePagination; |
||||
99 | use Spryker\Glue\GlueApplication\Rest\Response\ResponsePaginationInterface; |
||||
100 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseRelationship; |
||||
101 | use Spryker\Glue\GlueApplication\Rest\Response\ResponseRelationshipInterface; |
||||
102 | use Spryker\Glue\GlueApplication\Rest\Serialize\DecoderMatcher; |
||||
103 | use Spryker\Glue\GlueApplication\Rest\Serialize\DecoderMatcherInterface; |
||||
104 | use Spryker\Glue\GlueApplication\Rest\Serialize\EncoderMatcher; |
||||
105 | use Spryker\Glue\GlueApplication\Rest\Serialize\EncoderMatcherInterface; |
||||
106 | use Spryker\Glue\GlueApplication\Rest\Uri\UriParser as RestUriParser; |
||||
107 | use Spryker\Glue\GlueApplication\Rest\Uri\UriParserInterface as RestUriParserInterface; |
||||
108 | use Spryker\Glue\GlueApplication\Rest\User\RestUserValidator; |
||||
109 | use Spryker\Glue\GlueApplication\Rest\User\RestUserValidatorInterface; |
||||
110 | use Spryker\Glue\GlueApplication\Rest\User\UserProvider; |
||||
111 | use Spryker\Glue\GlueApplication\Rest\User\UserProviderInterface; |
||||
112 | use Spryker\Glue\GlueApplication\Rest\Version\VersionResolver; |
||||
113 | use Spryker\Glue\GlueApplication\Rest\Version\VersionResolverInterface; |
||||
114 | use Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Builder\RouterBuilder; |
||||
115 | use Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Builder\RouterBuilderInterface; |
||||
116 | use Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Cache\RouterCacheCollector; |
||||
117 | use Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Cache\RouterCacheCollectorInterface; |
||||
118 | use Spryker\Glue\GlueApplication\Router\CustomRouteRouter\CustomRouteMatcher; |
||||
119 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\ConventionResourceFilter; |
||||
120 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\ConventionResourceFilterInterface; |
||||
121 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\RequestResourcePluginFilter; |
||||
122 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\RequestResourcePluginFilterInterface; |
||||
123 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\ResourceRouteMatcher; |
||||
124 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\Uri\UriParser; |
||||
125 | use Spryker\Glue\GlueApplication\Router\ResourceRouter\Uri\UriParserInterface; |
||||
126 | use Spryker\Glue\GlueApplication\Router\RouteMatcherCollection; |
||||
127 | use Spryker\Glue\GlueApplication\Router\RouteMatcherInterface; |
||||
128 | use Spryker\Glue\GlueApplication\Serialize\Decoder\DecoderInterface; |
||||
129 | use Spryker\Glue\GlueApplication\Serialize\Decoder\JsonDecoder; |
||||
130 | use Spryker\Glue\GlueApplication\Serialize\Encoder\EncoderInterface; |
||||
131 | use Spryker\Glue\GlueApplication\Serialize\Encoder\JsonEncoder; |
||||
132 | use Spryker\Glue\GlueApplication\Validator\Request\AcceptedFormatValidator; |
||||
133 | use Spryker\Glue\GlueApplication\Validator\Request\FilterRequestValidator; |
||||
134 | use Spryker\Glue\GlueApplication\Validator\Request\RequestValidatorInterface as RequestRequestValidatorInterface; |
||||
135 | use Spryker\Glue\GlueApplication\Validator\RequestValidator; |
||||
136 | use Spryker\Glue\GlueApplication\Validator\RequestValidatorInterface; |
||||
137 | use Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\GlueApplicationBootstrapPluginInterface; |
||||
138 | use Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceRelationshipCollectionInterface; |
||||
139 | use Spryker\Glue\Kernel\AbstractFactory; |
||||
140 | use Spryker\Service\Container\ContainerInterface; |
||||
141 | use Spryker\Shared\Application\ApplicationInterface; |
||||
142 | use Spryker\Shared\Kernel\Container\ContainerProxy; |
||||
143 | use Symfony\Component\Console\Input\InputInterface; |
||||
144 | use Symfony\Component\Console\Output\OutputInterface; |
||||
145 | use Symfony\Component\Console\Style\SymfonyStyle; |
||||
146 | use Symfony\Component\HttpFoundation\Request; |
||||
147 | use Symfony\Component\HttpFoundation\Response; |
||||
148 | |||||
149 | /** |
||||
150 | * @method \Spryker\Glue\GlueApplication\GlueApplicationConfig getConfig() |
||||
151 | */ |
||||
152 | class GlueApplicationFactory extends AbstractFactory |
||||
153 | { |
||||
154 | /** |
||||
155 | * @deprecated Will be removed without replacement. |
||||
156 | * |
||||
157 | * @return \Spryker\Glue\GlueApplication\Rest\ControllerFilterInterface |
||||
158 | */ |
||||
159 | public function createRestControllerFilter(): ControllerFilterInterface |
||||
160 | { |
||||
161 | return new ControllerFilter( |
||||
162 | $this->createRestRequestFormatter(), |
||||
163 | $this->createRestResponseFormatter(), |
||||
164 | $this->createRestResponseHeaders(), |
||||
165 | $this->createRestHttpRequestValidator(), |
||||
166 | $this->createRestRequestValidator(), |
||||
167 | $this->createRestUserValidator(), |
||||
168 | $this->createRestResourceBuilder(), |
||||
169 | $this->createRestControllerCallbacks(), |
||||
170 | $this->getConfig(), |
||||
171 | $this->createUserProvider(), |
||||
172 | $this->createFormattedControllerBeforeAction(), |
||||
173 | ); |
||||
174 | } |
||||
175 | |||||
176 | /** |
||||
177 | * @deprecated Will be removed without replacement. |
||||
178 | * |
||||
179 | * @return \Spryker\Glue\GlueApplication\Rest\Request\RequestFormatterInterface |
||||
180 | */ |
||||
181 | public function createRestRequestFormatter(): RequestFormatterInterface |
||||
182 | { |
||||
183 | return new RequestFormatter( |
||||
184 | $this->createRestRequestMetaDataExtractor(), |
||||
185 | $this->createRestRequestResourceExtractor(), |
||||
186 | $this->getConfig(), |
||||
187 | $this->getFormatRequestPlugins(), |
||||
188 | ); |
||||
189 | } |
||||
190 | |||||
191 | /** |
||||
192 | * @deprecated Will be removed without replacement. |
||||
193 | * |
||||
194 | * @return \Spryker\Glue\GlueApplication\Rest\Response\ResponseFormatterInterface |
||||
195 | */ |
||||
196 | public function createRestResponseFormatter(): RestResponseFormatterInterface |
||||
197 | { |
||||
198 | return new RestResponseFormatter( |
||||
199 | $this->createRestEncoderMatcher(), |
||||
200 | $this->createRestResponseBuilder(), |
||||
201 | $this->getFormatResponseDataPlugins(), |
||||
202 | ); |
||||
203 | } |
||||
204 | |||||
205 | /** |
||||
206 | * @deprecated Will be removed without replacement. |
||||
207 | * |
||||
208 | * @return \Spryker\Glue\GlueApplication\Rest\ResourceRelationshipLoaderInterface |
||||
209 | */ |
||||
210 | public function createRestResourceRelationshipLoader(): ResourceRelationshipLoaderInterface |
||||
211 | { |
||||
212 | return new ResourceRelationshipLoader($this->getResourceProviderPlugins()); |
||||
213 | } |
||||
214 | |||||
215 | /** |
||||
216 | * @deprecated Will be removed without replacement. |
||||
217 | * |
||||
218 | * @return \Spryker\Glue\GlueApplication\Rest\ResourceRouterInterface |
||||
219 | */ |
||||
220 | public function createRestResourceRouter(): RestResourceRouterInterface |
||||
221 | { |
||||
222 | return new RestResourceRouter( |
||||
223 | $this->createRestHttpRequestValidator(), |
||||
224 | $this->getGlueApplication(), |
||||
225 | $this->createRestUriParser(), |
||||
226 | $this->createRestResourceRouteLoader(), |
||||
227 | $this->getRouterParameterExpanderPlugins(), |
||||
228 | ); |
||||
229 | } |
||||
230 | |||||
231 | /** |
||||
232 | * @deprecated Will be removed without replacement. |
||||
233 | * |
||||
234 | * @return \Spryker\Glue\GlueApplication\Rest\Response\ResponseBuilderInterface |
||||
235 | */ |
||||
236 | public function createRestResponseBuilder(): ResponseBuilderInterface |
||||
237 | { |
||||
238 | return new ResponseBuilder( |
||||
239 | $this->getConfig()->getGlueDomainName(), |
||||
240 | $this->createRestResponsePagination(), |
||||
241 | $this->createRestResponseRelationship(), |
||||
242 | ); |
||||
243 | } |
||||
244 | |||||
245 | /** |
||||
246 | * @deprecated Will be removed without replacement. |
||||
247 | * |
||||
248 | * @return \Spryker\Glue\GlueApplication\Rest\Response\ResponseHeadersInterface |
||||
249 | */ |
||||
250 | public function createRestResponseHeaders(): ResponseHeadersInterface |
||||
251 | { |
||||
252 | return new ResponseHeaders( |
||||
253 | $this->getFormatResponseHeadersPlugins(), |
||||
254 | $this->createRestContentTypeResolver(), |
||||
255 | $this->getConfig(), |
||||
256 | ); |
||||
257 | } |
||||
258 | |||||
259 | /** |
||||
260 | * @deprecated Will be removed without replacement. |
||||
261 | * |
||||
262 | * @return \Spryker\Glue\GlueApplication\Rest\Request\RequestMetaDataExtractorInterface |
||||
263 | */ |
||||
264 | public function createRestRequestMetaDataExtractor(): RequestMetaDataExtractorInterface |
||||
265 | { |
||||
266 | return new RequestMetaDataExtractor( |
||||
267 | $this->createRestVersionResolver(), |
||||
268 | $this->createRestContentTypeResolver(), |
||||
269 | $this->createLanguageNegotiation(), |
||||
270 | ); |
||||
271 | } |
||||
272 | |||||
273 | /** |
||||
274 | * @deprecated Will be removed without replacement. |
||||
275 | * |
||||
276 | * @return \Spryker\Glue\GlueApplication\Rest\Serialize\DecoderMatcherInterface |
||||
277 | */ |
||||
278 | public function createRestDecoderMatcher(): DecoderMatcherInterface |
||||
279 | { |
||||
280 | return new DecoderMatcher([ |
||||
281 | DecoderMatcher::DEFAULT_FORMAT => $this->createJsonDecoder(), |
||||
282 | ]); |
||||
283 | } |
||||
284 | |||||
285 | /** |
||||
286 | * @deprecated Will be removed without replacement. |
||||
287 | * |
||||
288 | * @return \Spryker\Glue\GlueApplication\Rest\Serialize\EncoderMatcherInterface |
||||
289 | */ |
||||
290 | public function createRestEncoderMatcher(): EncoderMatcherInterface |
||||
291 | { |
||||
292 | return new EncoderMatcher([ |
||||
293 | EncoderMatcher::DEFAULT_FORMAT => $this->createJsonEncoder(), |
||||
294 | ]); |
||||
295 | } |
||||
296 | |||||
297 | /** |
||||
298 | * @deprecated Will be removed without replacement. |
||||
299 | * |
||||
300 | * @return \Spryker\Glue\GlueApplication\Serialize\Encoder\EncoderInterface |
||||
301 | */ |
||||
302 | public function createJsonEncoder(): EncoderInterface |
||||
303 | { |
||||
304 | return new JsonEncoder($this->getUtilEncodingService()); |
||||
305 | } |
||||
306 | |||||
307 | /** |
||||
308 | * @deprecated Will be removed without replacement. |
||||
309 | * |
||||
310 | * @return \Spryker\Glue\GlueApplication\Serialize\Decoder\DecoderInterface |
||||
311 | */ |
||||
312 | public function createJsonDecoder(): DecoderInterface |
||||
313 | { |
||||
314 | return new JsonDecoder($this->getUtilEncodingService()); |
||||
315 | } |
||||
316 | |||||
317 | /** |
||||
318 | * @deprecated Will be removed without replacement. |
||||
319 | * |
||||
320 | * @return \Spryker\Glue\GlueApplication\Rest\Uri\UriParserInterface |
||||
321 | */ |
||||
322 | public function createRestUriParser(): RestUriParserInterface |
||||
323 | { |
||||
324 | return new RestUriParser($this->createRestVersionResolver()); |
||||
325 | } |
||||
326 | |||||
327 | /** |
||||
328 | * @deprecated Will be removed without replacement. |
||||
329 | * |
||||
330 | * @return \Spryker\Glue\GlueApplication\Rest\ResourceRouteLoaderInterface |
||||
331 | */ |
||||
332 | public function createRestResourceRouteLoader(): ResourceRouteLoaderInterface |
||||
333 | { |
||||
334 | return new ResourceRouteLoader( |
||||
335 | $this->getResourceRoutePlugins(), |
||||
336 | $this->createRestVersionResolver(), |
||||
337 | $this->getRouterParameterExpanderPlugins(), |
||||
338 | ); |
||||
339 | } |
||||
340 | |||||
341 | /** |
||||
342 | * @deprecated Will be removed without replacement. |
||||
343 | * |
||||
344 | * @return \Spryker\Glue\GlueApplication\Rest\Request\HttpRequestValidatorInterface |
||||
345 | */ |
||||
346 | public function createRestHttpRequestValidator(): HttpRequestValidatorInterface |
||||
347 | { |
||||
348 | return new HttpRequestValidator( |
||||
349 | $this->getValidateRequestPlugins(), |
||||
350 | $this->createRestResourceRouteLoader(), |
||||
351 | $this->getConfig(), |
||||
352 | $this->createHeadersHttpRequestValidator(), |
||||
353 | ); |
||||
354 | } |
||||
355 | |||||
356 | /** |
||||
357 | * @deprecated Will be removed without replacement. |
||||
358 | * |
||||
359 | * @return \Spryker\Glue\GlueApplication\Rest\Request\FormattedControllerBeforeActionInterface |
||||
360 | */ |
||||
361 | public function createFormattedControllerBeforeAction(): FormattedControllerBeforeActionInterface |
||||
362 | { |
||||
363 | return new FormattedControllerBeforeAction($this->getFormattedControllerBeforeActionPlugins()); |
||||
364 | } |
||||
365 | |||||
366 | /** |
||||
367 | * @deprecated Use {@link \Spryker\Glue\GlueApplication\Plugin\EventDispatcher\GlueRestControllerListenerEventDispatcherPlugin} instead. |
||||
368 | * |
||||
369 | * @return \Spryker\Glue\GlueApplication\Plugin\Rest\GlueControllerListenerPlugin |
||||
370 | */ |
||||
371 | public function createRestControllerListener(): GlueControllerListenerPlugin |
||||
372 | { |
||||
373 | return new GlueControllerListenerPlugin(); |
||||
374 | } |
||||
375 | |||||
376 | /** |
||||
377 | * @deprecated Will be removed without replacement. |
||||
378 | * |
||||
379 | * @return \Spryker\Glue\GlueApplication\Rest\JsonApi\RestResourceBuilderInterface |
||||
380 | */ |
||||
381 | public function createRestResourceBuilder(): RestResourceBuilderInterface |
||||
382 | { |
||||
383 | return new RestResourceBuilder(); |
||||
384 | } |
||||
385 | |||||
386 | /** |
||||
387 | * @deprecated Will be removed without replacement. |
||||
388 | * |
||||
389 | * @return \Spryker\Glue\GlueApplication\Rest\Request\RestRequestValidatorInterface |
||||
390 | */ |
||||
391 | public function createRestRequestValidator(): RestRequestValidatorInterface |
||||
392 | { |
||||
393 | return new RestRequestValidator($this->getValidateRestRequestPlugins(), $this->getRestRequestValidatorPlugins()); |
||||
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||||
394 | } |
||||
395 | |||||
396 | /** |
||||
397 | * @deprecated Will be removed without replacement. |
||||
398 | * |
||||
399 | * @return \Spryker\Glue\GlueApplication\Rest\ControllerCallbacksInterface |
||||
400 | */ |
||||
401 | public function createRestControllerCallbacks(): ControllerCallbacksInterface |
||||
402 | { |
||||
403 | return new ControllerCallbacks($this->getControllerBeforeActionPlugins(), $this->getControllerAfterActionPlugins()); |
||||
404 | } |
||||
405 | |||||
406 | /** |
||||
407 | * @deprecated Will be removed without replacement. |
||||
408 | * |
||||
409 | * @return \Spryker\Glue\GlueApplication\Rest\Version\VersionResolverInterface |
||||
410 | */ |
||||
411 | public function createRestVersionResolver(): VersionResolverInterface |
||||
412 | { |
||||
413 | return new VersionResolver($this->createRestContentTypeResolver(), $this->getConfig()); |
||||
0 ignored issues
–
show
The class
Spryker\Glue\GlueApplica...Version\VersionResolver has been deprecated: Will be removed without replacement.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
414 | } |
||||
415 | |||||
416 | /** |
||||
417 | * @deprecated Will be removed without replacement. |
||||
418 | * |
||||
419 | * @return \Spryker\Glue\GlueApplication\Rest\ContentType\ContentTypeResolverInterface |
||||
420 | */ |
||||
421 | public function createRestContentTypeResolver(): ContentTypeResolverInterface |
||||
422 | { |
||||
423 | return new ContentTypeResolver(); |
||||
424 | } |
||||
425 | |||||
426 | /** |
||||
427 | * @deprecated Will be removed without replacement. |
||||
428 | * |
||||
429 | * @return \Spryker\Glue\GlueApplication\Rest\Cors\CorsResponseInterface |
||||
430 | */ |
||||
431 | public function createRestCorsResponse(): CorsResponseInterface |
||||
432 | { |
||||
433 | return new CorsResponse($this->createRestResourceRouteLoader(), $this->getConfig(), $this->createRestUriParser()); |
||||
434 | } |
||||
435 | |||||
436 | /** |
||||
437 | * @deprecated Will be removed without replacement. |
||||
438 | * |
||||
439 | * @return \Spryker\Glue\GlueApplication\Rest\Language\LanguageNegotiationInterface |
||||
440 | */ |
||||
441 | public function createLanguageNegotiation(): LanguageNegotiationInterface |
||||
442 | { |
||||
443 | return new LanguageNegotiation($this->getStoreClient(), $this->getLocaleService()); |
||||
444 | } |
||||
445 | |||||
446 | /** |
||||
447 | * @deprecated Will be removed without replacement. |
||||
448 | * |
||||
449 | * @return \Spryker\Glue\GlueApplication\Rest\Response\ResponsePaginationInterface |
||||
450 | */ |
||||
451 | public function createRestResponsePagination(): ResponsePaginationInterface |
||||
452 | { |
||||
453 | return new ResponsePagination($this->getConfig()); |
||||
0 ignored issues
–
show
The class
Spryker\Glue\GlueApplica...onse\ResponsePagination has been deprecated: Will be removed without replacement.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
454 | } |
||||
455 | |||||
456 | /** |
||||
457 | * @deprecated Will be removed without replacement. |
||||
458 | * |
||||
459 | * @return \Spryker\Glue\GlueApplication\Rest\Response\ResponseRelationshipInterface |
||||
460 | */ |
||||
461 | public function createRestResponseRelationship(): ResponseRelationshipInterface |
||||
462 | { |
||||
463 | return new ResponseRelationship($this->createRestResourceRelationshipLoader()); |
||||
464 | } |
||||
465 | |||||
466 | /** |
||||
467 | * @deprecated Will be removed without replacement. |
||||
468 | * |
||||
469 | * @return \Spryker\Glue\GlueApplication\Rest\Request\RequestResourceExtractorInterface |
||||
470 | */ |
||||
471 | public function createRestRequestResourceExtractor(): RequestResourceExtractorInterface |
||||
472 | { |
||||
473 | return new RequestResourceExtractor( |
||||
474 | $this->createRestResourceBuilder(), |
||||
475 | $this->createRestDecoderMatcher(), |
||||
476 | ); |
||||
477 | } |
||||
478 | |||||
479 | /** |
||||
480 | * @deprecated Will be removed without replacement. |
||||
481 | * |
||||
482 | * @return \Spryker\Glue\GlueApplication\Rest\User\UserProviderInterface |
||||
483 | */ |
||||
484 | public function createUserProvider(): UserProviderInterface |
||||
485 | { |
||||
486 | return new UserProvider( |
||||
487 | $this->getRestUserFinderPlugins(), |
||||
488 | ); |
||||
489 | } |
||||
490 | |||||
491 | /** |
||||
492 | * @deprecated Will be removed without replacement. |
||||
493 | * |
||||
494 | * @return \Spryker\Glue\GlueApplication\Rest\User\RestUserValidatorInterface |
||||
495 | */ |
||||
496 | public function createRestUserValidator(): RestUserValidatorInterface |
||||
497 | { |
||||
498 | return new RestUserValidator( |
||||
499 | $this->getRestUserValidatorPlugins(), |
||||
500 | ); |
||||
501 | } |
||||
502 | |||||
503 | /** |
||||
504 | * @deprecated Will be removed without replacement. |
||||
505 | * |
||||
506 | * @return \Spryker\Glue\GlueApplication\Rest\Request\PaginationParametersHttpRequestValidatorInterface |
||||
507 | */ |
||||
508 | public function createPaginationParametersRequestValidator(): PaginationParametersHttpRequestValidatorInterface |
||||
509 | { |
||||
510 | return new PaginationParametersHttpRequestValidator(); |
||||
511 | } |
||||
512 | |||||
513 | /** |
||||
514 | * @deprecated Will be removed without replacement. |
||||
515 | * |
||||
516 | * @return \Spryker\Glue\GlueApplication\Rest\Request\HeadersHttpRequestValidatorInterface |
||||
517 | */ |
||||
518 | public function createHeadersHttpRequestValidator(): HeadersHttpRequestValidatorInterface |
||||
519 | { |
||||
520 | return new HeadersHttpRequestValidator( |
||||
521 | $this->getConfig(), |
||||
522 | $this->createRestResourceRouteLoader(), |
||||
523 | ); |
||||
524 | } |
||||
525 | |||||
526 | /** |
||||
527 | * @deprecated Will be removed without replacement. |
||||
528 | * |
||||
529 | * @return \Spryker\Glue\GlueApplication\Rest\Request\CorsHttpRequestValidatorInterface |
||||
530 | */ |
||||
531 | public function createCorsHttpRequestValidator(): CorsHttpRequestValidatorInterface |
||||
532 | { |
||||
533 | return new CorsHttpRequestValidator(); |
||||
534 | } |
||||
535 | |||||
536 | /** |
||||
537 | * @deprecated Will be removed without replacement. |
||||
538 | * |
||||
539 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ValidateRestRequestPluginInterface> |
||||
540 | */ |
||||
541 | public function getValidateRestRequestPlugins(): array |
||||
542 | { |
||||
543 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_VALIDATE_REST_REQUEST); |
||||
544 | } |
||||
545 | |||||
546 | /** |
||||
547 | * @deprecated Will be removed without replacement. |
||||
548 | * |
||||
549 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RestUserValidatorPluginInterface> |
||||
550 | */ |
||||
551 | public function getRestUserValidatorPlugins(): array |
||||
552 | { |
||||
553 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_VALIDATE_REST_USER); |
||||
554 | } |
||||
555 | |||||
556 | /** |
||||
557 | * @deprecated Will be removed without replacement. |
||||
558 | * |
||||
559 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RestRequestValidatorPluginInterface> |
||||
560 | */ |
||||
561 | public function getRestRequestValidatorPlugins(): array |
||||
562 | { |
||||
563 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_REST_REQUEST_VALIDATOR); |
||||
564 | } |
||||
565 | |||||
566 | /** |
||||
567 | * @deprecated Will be removed without replacement. |
||||
568 | * |
||||
569 | * @return \Spryker\Service\Container\ContainerInterface |
||||
570 | */ |
||||
571 | public function getGlueApplication(): ContainerInterface |
||||
572 | { |
||||
573 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::APPLICATION_GLUE); |
||||
574 | } |
||||
575 | |||||
576 | /** |
||||
577 | * @return \Spryker\Glue\GlueApplication\Dependency\Service\GlueApplicationToUtilEncodingServiceInterface |
||||
578 | */ |
||||
579 | public function getUtilEncodingService(): GlueApplicationToUtilEncodingServiceInterface |
||||
580 | { |
||||
581 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::SERVICE_UTIL_ENCODING); |
||||
582 | } |
||||
583 | |||||
584 | /** |
||||
585 | * @deprecated Will be removed without replacement. |
||||
586 | * |
||||
587 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceRoutePluginInterface> |
||||
588 | */ |
||||
589 | public function getResourceRoutePlugins(): array |
||||
590 | { |
||||
591 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_RESOURCE_ROUTES); |
||||
592 | } |
||||
593 | |||||
594 | /** |
||||
595 | * @deprecated Will be removed without replacement. |
||||
596 | * |
||||
597 | * @return \Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceRelationshipCollectionInterface |
||||
598 | */ |
||||
599 | public function getResourceProviderPlugins(): ResourceRelationshipCollectionInterface |
||||
600 | { |
||||
601 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_RESOURCE_RELATIONSHIP); |
||||
602 | } |
||||
603 | |||||
604 | /** |
||||
605 | * @deprecated Will be removed without replacement. |
||||
606 | * |
||||
607 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ValidateHttpRequestPluginInterface> |
||||
608 | */ |
||||
609 | public function getValidateRequestPlugins(): array |
||||
610 | { |
||||
611 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_VALIDATE_HTTP_REQUEST); |
||||
612 | } |
||||
613 | |||||
614 | /** |
||||
615 | * @deprecated Will be removed without replacement. |
||||
616 | * |
||||
617 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\FormattedControllerBeforeActionPluginInterface> |
||||
618 | */ |
||||
619 | public function getFormattedControllerBeforeActionPlugins(): array |
||||
620 | { |
||||
621 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_FORMATTED_CONTROLLER_BEFORE_ACTION); |
||||
622 | } |
||||
623 | |||||
624 | /** |
||||
625 | * @deprecated Will be removed without replacement. |
||||
626 | * |
||||
627 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\FormatRequestPluginInterface> |
||||
628 | */ |
||||
629 | public function getFormatRequestPlugins(): array |
||||
630 | { |
||||
631 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_FORMAT_REQUEST); |
||||
632 | } |
||||
633 | |||||
634 | /** |
||||
635 | * @deprecated Will be removed without replacement. |
||||
636 | * |
||||
637 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\FormatResponseDataPluginInterface> |
||||
638 | */ |
||||
639 | public function getFormatResponseDataPlugins(): array |
||||
640 | { |
||||
641 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_FORMAT_RESPONSE_DATA); |
||||
642 | } |
||||
643 | |||||
644 | /** |
||||
645 | * @deprecated Will be removed without replacement. |
||||
646 | * |
||||
647 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\FormatResponseHeadersPluginInterface> |
||||
648 | */ |
||||
649 | public function getFormatResponseHeadersPlugins(): array |
||||
650 | { |
||||
651 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_FORMAT_RESPONSE_HEADERS); |
||||
652 | } |
||||
653 | |||||
654 | /** |
||||
655 | * @deprecated Will be removed without replacement. |
||||
656 | * |
||||
657 | * @return \Spryker\Glue\GlueApplication\Dependency\Client\GlueApplicationToStoreClientInterface |
||||
658 | */ |
||||
659 | public function getStoreClient(): GlueApplicationToStoreClientInterface |
||||
660 | { |
||||
661 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::CLIENT_STORE); |
||||
662 | } |
||||
663 | |||||
664 | /** |
||||
665 | * @deprecated Will be removed without replacement. |
||||
666 | * |
||||
667 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ControllerBeforeActionPluginInterface> |
||||
668 | */ |
||||
669 | public function getControllerBeforeActionPlugins(): array |
||||
670 | { |
||||
671 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_CONTROLLER_BEFORE_ACTION); |
||||
672 | } |
||||
673 | |||||
674 | /** |
||||
675 | * @deprecated Will be removed without replacement. |
||||
676 | * |
||||
677 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ControllerAfterActionPluginInterface> |
||||
678 | */ |
||||
679 | public function getControllerAfterActionPlugins(): array |
||||
680 | { |
||||
681 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_CONTROLLER_AFTER_ACTION); |
||||
682 | } |
||||
683 | |||||
684 | /** |
||||
685 | * @deprecated Will be removed without replacement. |
||||
686 | * |
||||
687 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RestUserFinderPluginInterface> |
||||
688 | */ |
||||
689 | public function getRestUserFinderPlugins(): array |
||||
690 | { |
||||
691 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_REST_USER_FINDER); |
||||
692 | } |
||||
693 | |||||
694 | /** |
||||
695 | * @deprecated Will be removed without replacement. |
||||
696 | * |
||||
697 | * @return \Spryker\Service\Container\ContainerInterface |
||||
698 | */ |
||||
699 | public function createServiceContainer(): ContainerInterface |
||||
700 | { |
||||
701 | return new ContainerProxy(['logger' => null, 'debug' => $this->getConfig()->isDebugModeEnabled(), 'charset' => 'UTF-8']); |
||||
702 | } |
||||
703 | |||||
704 | /** |
||||
705 | * @deprecated Will be removed without replacement. |
||||
706 | * |
||||
707 | * @return array<\Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface> |
||||
708 | */ |
||||
709 | public function getApplicationPlugins(): array |
||||
710 | { |
||||
711 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_APPLICATION); |
||||
712 | } |
||||
713 | |||||
714 | /** |
||||
715 | * @deprecated Will be removed without replacement. |
||||
716 | * |
||||
717 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RouterParameterExpanderPluginInterface> |
||||
718 | */ |
||||
719 | public function getRouterParameterExpanderPlugins(): array |
||||
720 | { |
||||
721 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_ROUTER_PARAMETER_EXPANDER); |
||||
722 | } |
||||
723 | |||||
724 | /** |
||||
725 | * @deprecated Will be removed without replacement. |
||||
726 | * |
||||
727 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\GlueContextExpanderPluginInterface> |
||||
728 | */ |
||||
729 | public function getGlueContextExpanderPlugins(): array |
||||
730 | { |
||||
731 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGIN_API_CONTEXT_EXPANDER); |
||||
732 | } |
||||
733 | |||||
734 | /** |
||||
735 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\GlueApplicationBootstrapPluginInterface> |
||||
736 | */ |
||||
737 | public function getBootstrapPlugins(): array |
||||
738 | { |
||||
739 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_GLUE_APPLICATION_BOOTSTRAP); |
||||
740 | } |
||||
741 | |||||
742 | /** |
||||
743 | * @param array<string> $glueApplicationBootstrapPluginClassNames |
||||
744 | * |
||||
745 | * @return \Spryker\Glue\GlueApplication\ApiApplication\ApiApplicationBootstrapResolverInterface |
||||
746 | */ |
||||
747 | public function createApiApplicationBootstrapResolver(array $glueApplicationBootstrapPluginClassNames = []): ApiApplicationBootstrapResolverInterface |
||||
748 | { |
||||
749 | return new ApiApplicationBootstrapResolver($glueApplicationBootstrapPluginClassNames, $this->getBootstrapPlugins()); |
||||
750 | } |
||||
751 | |||||
752 | /** |
||||
753 | * @param \Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\GlueApplicationBootstrapPluginInterface $glueApplicationBootstrapPlugin |
||||
754 | * |
||||
755 | * @return \Spryker\Shared\Application\ApplicationInterface |
||||
756 | */ |
||||
757 | public function createApiApplicationProxy(GlueApplicationBootstrapPluginInterface $glueApplicationBootstrapPlugin): ApplicationInterface |
||||
758 | { |
||||
759 | return new ApiApplicationProxy( |
||||
760 | $glueApplicationBootstrapPlugin, |
||||
761 | $this->createRequestFlowExecutor(), |
||||
762 | $this->getCommunicationProtocolPlugins(), |
||||
763 | $this->getConventionPlugins(), |
||||
764 | $this->createHttpRequestBuilder(), |
||||
765 | $this->createHttpSender(), |
||||
766 | $this->createContentNegotiator(), |
||||
767 | $this->createRequest(), |
||||
768 | $this->getConfig(), |
||||
769 | ); |
||||
770 | } |
||||
771 | |||||
772 | /** |
||||
773 | * @return \Spryker\Shared\Application\ApplicationInterface |
||||
774 | */ |
||||
775 | public function createGlueStorefrontFallbackApiApplication(): ApplicationInterface |
||||
776 | { |
||||
777 | return new GlueStorefrontFallbackApiApplication($this->createServiceContainer(), $this->getApplicationPlugins()); |
||||
778 | } |
||||
779 | |||||
780 | /** |
||||
781 | * @return \Spryker\Glue\GlueApplication\ApiApplication\RequestFlowExecutorInterface |
||||
782 | */ |
||||
783 | public function createRequestFlowExecutor(): RequestFlowExecutorInterface |
||||
784 | { |
||||
785 | return new RequestFlowExecutor( |
||||
786 | $this->createResourceExecutor(), |
||||
787 | $this->createRouteMatcher(), |
||||
788 | $this->createRequestBuilder(), |
||||
789 | $this->createRequestValidator(), |
||||
790 | $this->createResponseFormatter(), |
||||
791 | ); |
||||
792 | } |
||||
793 | |||||
794 | /** |
||||
795 | * @return \Spryker\Glue\GlueApplication\Builder\RequestBuilderInterface |
||||
796 | */ |
||||
797 | public function createRequestBuilder(): RequestBuilderWrapperInterface |
||||
798 | { |
||||
799 | return new RequestBuilderWrapper( |
||||
800 | $this->getRequestBuilderPlugins(), |
||||
801 | $this->createRequestBuilders(), |
||||
802 | ); |
||||
803 | } |
||||
804 | |||||
805 | /** |
||||
806 | * @return \Spryker\Glue\GlueApplication\Validator\RequestValidatorInterface |
||||
807 | */ |
||||
808 | public function createRequestValidator(): RequestValidatorInterface |
||||
809 | { |
||||
810 | return new RequestValidator( |
||||
811 | $this->getRequestValidatorPlugins(), |
||||
812 | $this->getRequestAfterRoutingValidatorPlugins(), |
||||
813 | $this->createRequestValidators(), |
||||
814 | ); |
||||
815 | } |
||||
816 | |||||
817 | /** |
||||
818 | * @return \Spryker\Glue\GlueApplication\Formatter\ResponseFormatterInterface |
||||
819 | */ |
||||
820 | public function createResponseFormatter(): ResponseFormatterInterface |
||||
821 | { |
||||
822 | return new ResponseFormatter( |
||||
823 | $this->getResponseFormatterPlugins(), |
||||
824 | $this->createResponseFormatters(), |
||||
825 | ); |
||||
826 | } |
||||
827 | |||||
828 | /** |
||||
829 | * @deprecated Will be removed without replacement. |
||||
830 | * |
||||
831 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\CommunicationProtocolPluginInterface> |
||||
832 | */ |
||||
833 | public function getCommunicationProtocolPlugins(): array |
||||
834 | { |
||||
835 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_COMMUNICATION_PROTOCOL); |
||||
836 | } |
||||
837 | |||||
838 | /** |
||||
839 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ConventionPluginInterface> |
||||
840 | */ |
||||
841 | public function getConventionPlugins(): array |
||||
842 | { |
||||
843 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_CONVENTION); |
||||
844 | } |
||||
845 | |||||
846 | /** |
||||
847 | * @return \Spryker\Glue\GlueApplication\Executor\ResourceExecutorInterface |
||||
848 | */ |
||||
849 | public function createResourceExecutor(): ResourceExecutorInterface |
||||
850 | { |
||||
851 | return new ResourceExecutor( |
||||
852 | $this->createControllerCacheReader(), |
||||
853 | $this->createControllerCacheWriter(), |
||||
854 | $this->getConfig(), |
||||
855 | ); |
||||
856 | } |
||||
857 | |||||
858 | /** |
||||
859 | * @return \Spryker\Glue\GlueApplication\Router\ResourceRouter\RequestResourcePluginFilterInterface |
||||
860 | */ |
||||
861 | public function createRequestResourcePluginFilter(): RequestResourcePluginFilterInterface |
||||
862 | { |
||||
863 | return new RequestResourcePluginFilter($this->createConventionResourceFilter()); |
||||
864 | } |
||||
865 | |||||
866 | /** |
||||
867 | * @return \Spryker\Glue\GlueApplication\Router\ResourceRouter\ConventionResourceFilterInterface |
||||
868 | */ |
||||
869 | public function createConventionResourceFilter(): ConventionResourceFilterInterface |
||||
870 | { |
||||
871 | return new ConventionResourceFilter($this->getConventionPlugins()); |
||||
872 | } |
||||
873 | |||||
874 | /** |
||||
875 | * @return \Spryker\Glue\GlueApplication\Plugin\Console\Helper\DescriptorHelper |
||||
876 | */ |
||||
877 | public function createDescriptorHelper(): DescriptorHelper |
||||
878 | { |
||||
879 | return new DescriptorHelper( |
||||
880 | $this->createTextDescriptor(), |
||||
881 | ); |
||||
882 | } |
||||
883 | |||||
884 | /** |
||||
885 | * @return \Spryker\Glue\GlueApplication\Descriptor\TextDescriptor |
||||
886 | */ |
||||
887 | public function createTextDescriptor(): TextDescriptor |
||||
888 | { |
||||
889 | return new TextDescriptor( |
||||
890 | $this->getTableColumnExpanderPlugins(), |
||||
891 | ); |
||||
892 | } |
||||
893 | |||||
894 | /** |
||||
895 | * @param \Symfony\Component\Console\Input\InputInterface $input |
||||
896 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||||
897 | * |
||||
898 | * @return \Symfony\Component\Console\Style\SymfonyStyle |
||||
899 | */ |
||||
900 | public function createConsoleOutputStyle(InputInterface $input, OutputInterface $output): SymfonyStyle |
||||
901 | { |
||||
902 | return new SymfonyStyle($input, $output); |
||||
903 | } |
||||
904 | |||||
905 | /** |
||||
906 | * @return \Spryker\Glue\GlueApplication\Router\ResourceRouter\Uri\UriParserInterface |
||||
907 | */ |
||||
908 | public function createUriParser(): UriParserInterface |
||||
909 | { |
||||
910 | return new UriParser(); |
||||
911 | } |
||||
912 | |||||
913 | /** |
||||
914 | * @return \Spryker\Glue\GlueApplication\Cache\Writer\ControllerCacheWriterInterface |
||||
915 | */ |
||||
916 | public function createControllerCacheWriter(): ControllerCacheWriterInterface |
||||
917 | { |
||||
918 | return new ControllerCacheWriter( |
||||
919 | $this->getControllerCacheCollectorPlugins(), |
||||
920 | $this->getConfig(), |
||||
921 | $this->getFilesystem(), |
||||
922 | $this->getControllerConfigurationCacheCollectorPlugins(), |
||||
923 | ); |
||||
924 | } |
||||
925 | |||||
926 | /** |
||||
927 | * @return \Spryker\Glue\GlueApplication\Cache\Reader\ControllerCacheReaderInterface |
||||
928 | */ |
||||
929 | public function createControllerCacheReader(): ControllerCacheReaderInterface |
||||
930 | { |
||||
931 | return new ControllerCacheReader( |
||||
932 | $this->createControllerCacheWriter(), |
||||
933 | $this->getConfig(), |
||||
934 | ); |
||||
935 | } |
||||
936 | |||||
937 | /** |
||||
938 | * @return \Spryker\Glue\GlueApplication\Dependency\External\GlueApplicationToSymfonyFilesystemInterface |
||||
939 | */ |
||||
940 | public function getFilesystem(): GlueApplicationToSymfonyFilesystemInterface |
||||
941 | { |
||||
942 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::FILESYSTEM); |
||||
943 | } |
||||
944 | |||||
945 | /** |
||||
946 | * @deprecated Use {@link \Spryker\Glue\GlueApplication\GlueApplicationFactory::getControllerConfigurationCacheCollectorPlugins()} instead. |
||||
947 | * |
||||
948 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ControllerCacheCollectorPluginInterface> |
||||
949 | */ |
||||
950 | public function getControllerCacheCollectorPlugins(): array |
||||
951 | { |
||||
952 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_CONTROLLER_CACHE_COLLECTOR); |
||||
953 | } |
||||
954 | |||||
955 | /** |
||||
956 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ControllerConfigurationCacheCollectorPluginInterface> |
||||
957 | */ |
||||
958 | public function getControllerConfigurationCacheCollectorPlugins(): array |
||||
959 | { |
||||
960 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_CONTROLLER_CONFIGURATION_CACHE_COLLECTOR); |
||||
961 | } |
||||
962 | |||||
963 | /** |
||||
964 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ApiApplicationEndpointProviderPluginInterface> |
||||
965 | */ |
||||
966 | public function getGlueApplicationRouterProviderPlugins(): array |
||||
967 | { |
||||
968 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_GLUE_APPLICATION_ROUTER_PROVIDER); |
||||
969 | } |
||||
970 | |||||
971 | /** |
||||
972 | * @return \Spryker\Glue\GlueApplication\Router\RouteMatcherInterface |
||||
973 | */ |
||||
974 | public function createCustomRouteMatcher(): RouteMatcherInterface |
||||
975 | { |
||||
976 | return new CustomRouteMatcher($this->createRouterBuilder()); |
||||
977 | } |
||||
978 | |||||
979 | /** |
||||
980 | * @return \Spryker\Glue\GlueApplication\Router\RouteMatcherInterface |
||||
981 | */ |
||||
982 | public function createResourceRouteMatcher(): RouteMatcherInterface |
||||
983 | { |
||||
984 | return new ResourceRouteMatcher( |
||||
985 | $this->getResourcesProviderPlugins(), |
||||
986 | $this->createUriParser(), |
||||
987 | $this->createRequestResourcePluginFilter(), |
||||
988 | ); |
||||
989 | } |
||||
990 | |||||
991 | /** |
||||
992 | * @return \Spryker\Glue\GlueApplication\Router\RouteMatcherInterface |
||||
993 | */ |
||||
994 | public function createRouteMatcher(): RouteMatcherInterface |
||||
995 | { |
||||
996 | return new RouteMatcherCollection( |
||||
997 | $this->getRouteMatchers(), |
||||
998 | $this->getConfig(), |
||||
999 | $this->createRouterCacheCollector(), |
||||
1000 | ); |
||||
1001 | } |
||||
1002 | |||||
1003 | /** |
||||
1004 | * @return array<\Spryker\Glue\GlueApplication\Router\RouteMatcherInterface> |
||||
1005 | */ |
||||
1006 | public function getRouteMatchers(): array |
||||
1007 | { |
||||
1008 | return [ |
||||
1009 | 'routes' => $this->createCustomRouteMatcher(), |
||||
1010 | 'resources' => $this->createResourceRouteMatcher(), |
||||
1011 | ]; |
||||
1012 | } |
||||
1013 | |||||
1014 | /** |
||||
1015 | * @return \Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Builder\RouterBuilderInterface |
||||
1016 | */ |
||||
1017 | public function createRouterBuilder(): RouterBuilderInterface |
||||
1018 | { |
||||
1019 | return new RouterBuilder($this->getRoutesProviderPlugins()); |
||||
1020 | } |
||||
1021 | |||||
1022 | /** |
||||
1023 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RoutesProviderPluginInterface> |
||||
1024 | */ |
||||
1025 | public function getRoutesProviderPlugins(): array |
||||
1026 | { |
||||
1027 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_ROUTES_PROVIDER); |
||||
1028 | } |
||||
1029 | |||||
1030 | /** |
||||
1031 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourcesProviderPluginInterface> |
||||
1032 | */ |
||||
1033 | public function getResourcesProviderPlugins(): array |
||||
1034 | { |
||||
1035 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_RESOURCES_PROVIDER); |
||||
1036 | } |
||||
1037 | |||||
1038 | /** |
||||
1039 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\TableColumnExpanderPluginInterface> |
||||
1040 | */ |
||||
1041 | public function getTableColumnExpanderPlugins(): array |
||||
1042 | { |
||||
1043 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_TABLE_COLUMN_EXPANDER); |
||||
1044 | } |
||||
1045 | |||||
1046 | /** |
||||
1047 | * @return \Spryker\Glue\GlueApplication\Router\CustomRouteRouter\Cache\RouterCacheCollectorInterface |
||||
1048 | */ |
||||
1049 | public function createRouterCacheCollector(): RouterCacheCollectorInterface |
||||
1050 | { |
||||
1051 | return new RouterCacheCollector( |
||||
1052 | $this->createRouterBuilder(), |
||||
1053 | $this->getRoutesProviderPlugins(), |
||||
1054 | ); |
||||
1055 | } |
||||
1056 | |||||
1057 | /** |
||||
1058 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestBuilderPluginInterface> |
||||
1059 | */ |
||||
1060 | public function getRequestBuilderPlugins(): array |
||||
1061 | { |
||||
1062 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_REQUEST_BUILDER); |
||||
1063 | } |
||||
1064 | |||||
1065 | /** |
||||
1066 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestValidatorPluginInterface> |
||||
1067 | */ |
||||
1068 | public function getRequestValidatorPlugins(): array |
||||
1069 | { |
||||
1070 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_REQUEST_VALIDATOR); |
||||
1071 | } |
||||
1072 | |||||
1073 | /** |
||||
1074 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestAfterRoutingValidatorPluginInterface> |
||||
1075 | */ |
||||
1076 | public function getRequestAfterRoutingValidatorPlugins(): array |
||||
1077 | { |
||||
1078 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_REQUEST_AFTER_ROUTING_VALIDATOR); |
||||
1079 | } |
||||
1080 | |||||
1081 | /** |
||||
1082 | * @return array<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResponseFormatterPluginInterface> |
||||
1083 | */ |
||||
1084 | public function getResponseFormatterPlugins(): array |
||||
1085 | { |
||||
1086 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::PLUGINS_RESPONSE_FORMATTER); |
||||
1087 | } |
||||
1088 | |||||
1089 | /** |
||||
1090 | * @return \Spryker\Glue\GlueApplication\Dependency\External\GlueApplicationToInflectorInterface |
||||
1091 | */ |
||||
1092 | public function getInflector(): GlueApplicationToInflectorInterface |
||||
1093 | { |
||||
1094 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::INFLECTOR); |
||||
1095 | } |
||||
1096 | |||||
1097 | /** |
||||
1098 | * @return \Spryker\Glue\GlueApplication\Formatter\Schema\RestApiSchemaParametersFormatterInterface |
||||
1099 | */ |
||||
1100 | public function createRestApiSchemaParametersFormatter(): RestApiSchemaParametersFormatterInterface |
||||
1101 | { |
||||
1102 | return new RestApiSchemaParametersFormatter(); |
||||
1103 | } |
||||
1104 | |||||
1105 | /** |
||||
1106 | * @return \Spryker\Glue\GlueApplication\Validator\Request\RequestValidatorInterface |
||||
1107 | */ |
||||
1108 | public function createAcceptedFormatValidator(): RequestRequestValidatorInterface |
||||
1109 | { |
||||
1110 | return new AcceptedFormatValidator($this->getResponseEncoderStrategies()); |
||||
1111 | } |
||||
1112 | |||||
1113 | /** |
||||
1114 | * @return \Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface |
||||
1115 | */ |
||||
1116 | public function createFilterFieldRequestBuilder(): RequestBuilderInterface |
||||
1117 | { |
||||
1118 | return new FilterFieldRequestBuilder(); |
||||
1119 | } |
||||
1120 | |||||
1121 | /** |
||||
1122 | * @return \Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface |
||||
1123 | */ |
||||
1124 | public function createSparseFieldRequestBuilder(): RequestBuilderInterface |
||||
1125 | { |
||||
1126 | return new SparseFieldRequestBuilder(); |
||||
1127 | } |
||||
1128 | |||||
1129 | /** |
||||
1130 | * @return \Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface |
||||
1131 | */ |
||||
1132 | public function createAttributesRequestBuilder(): RequestBuilderInterface |
||||
1133 | { |
||||
1134 | return new AttributesRequestBuilder( |
||||
1135 | $this->getUtilEncodingService(), |
||||
1136 | ); |
||||
1137 | } |
||||
1138 | |||||
1139 | /** |
||||
1140 | * @return \Spryker\Glue\GlueApplication\Formatter\Response\ResponseFormatterInterface |
||||
1141 | */ |
||||
1142 | public function createDefaultResponseFormatter(): DefaultConventionResponseFormatterInterface |
||||
1143 | { |
||||
1144 | return new DefaultConventionResponseFormatter( |
||||
1145 | $this->getResponseEncoderStrategies(), |
||||
1146 | $this->getConfig(), |
||||
1147 | ); |
||||
1148 | } |
||||
1149 | |||||
1150 | /** |
||||
1151 | * @return \Spryker\Glue\GlueApplication\Http\Request\RequestBuilderInterface |
||||
1152 | */ |
||||
1153 | public function createHttpRequestBuilder(): HttpRequestBuilderInterface |
||||
1154 | { |
||||
1155 | return new HttpRequestBuilder( |
||||
1156 | $this->createRequest(), |
||||
1157 | ); |
||||
1158 | } |
||||
1159 | |||||
1160 | /** |
||||
1161 | * @return \Spryker\Glue\GlueApplication\Http\Response\HttpSenderInterface; |
||||
1162 | */ |
||||
1163 | public function createHttpSender(): HttpSenderInterface |
||||
1164 | { |
||||
1165 | return new HttpSender( |
||||
1166 | $this->createResponse(), |
||||
1167 | ); |
||||
1168 | } |
||||
1169 | |||||
1170 | /** |
||||
1171 | * @return \Symfony\Component\HttpFoundation\Response |
||||
1172 | */ |
||||
1173 | public function createResponse(): Response |
||||
1174 | { |
||||
1175 | return new Response(); |
||||
1176 | } |
||||
1177 | |||||
1178 | /** |
||||
1179 | * @return \Symfony\Component\HttpFoundation\Request |
||||
1180 | */ |
||||
1181 | public function createRequest(): Request |
||||
1182 | { |
||||
1183 | return Request::createFromGlobals(); |
||||
1184 | } |
||||
1185 | |||||
1186 | /** |
||||
1187 | * @return \Spryker\Glue\GlueApplication\Http\Context\ContextHttpExpanderInterface |
||||
1188 | */ |
||||
1189 | public function createContextHttpExpander(): ContextHttpExpanderInterface |
||||
1190 | { |
||||
1191 | return new ContextHttpExpander( |
||||
1192 | $this->createRequest(), |
||||
1193 | ); |
||||
1194 | } |
||||
1195 | |||||
1196 | /** |
||||
1197 | * @return \Spryker\Glue\GlueApplication\Formatter\Schema\SchemaFormatterInterface |
||||
1198 | */ |
||||
1199 | public function createRestApiSchemaFormatter(): SchemaFormatterInterface |
||||
1200 | { |
||||
1201 | return new RestApiSchemaFormatter( |
||||
1202 | $this->getInflector(), |
||||
1203 | $this->createRestApiSchemaParametersFormatter(), |
||||
1204 | $this->getConfig(), |
||||
1205 | ); |
||||
1206 | } |
||||
1207 | |||||
1208 | /** |
||||
1209 | * @return \Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface |
||||
1210 | */ |
||||
1211 | public function createPaginationParameterRequestBuilder(): RequestBuilderInterface |
||||
1212 | { |
||||
1213 | return new PaginationParameterRequestBuilder(); |
||||
1214 | } |
||||
1215 | |||||
1216 | /** |
||||
1217 | * @return \Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface |
||||
1218 | */ |
||||
1219 | public function createSortParameterRequestBuilder(): RequestBuilderInterface |
||||
1220 | { |
||||
1221 | return new SortParameterRequestBuilder(); |
||||
1222 | } |
||||
1223 | |||||
1224 | /** |
||||
1225 | * @return \Spryker\Glue\GlueApplication\Encoder\Response\ResponseEncoderStrategyInterface |
||||
1226 | */ |
||||
1227 | public function createJsonResponseEncoderStrategy(): ResponseEncoderStrategyInterface |
||||
1228 | { |
||||
1229 | return new JsonResponseEncoderStrategy($this->getUtilEncodingService()); |
||||
1230 | } |
||||
1231 | |||||
1232 | /** |
||||
1233 | * @return array<\Spryker\Glue\GlueApplication\Encoder\Response\ResponseEncoderStrategyInterface> |
||||
1234 | */ |
||||
1235 | public function getResponseEncoderStrategies(): array |
||||
1236 | { |
||||
1237 | return [ |
||||
1238 | $this->createJsonResponseEncoderStrategy(), |
||||
1239 | ]; |
||||
1240 | } |
||||
1241 | |||||
1242 | /** |
||||
1243 | * @return array<\Spryker\Glue\GlueApplication\Builder\Request\RequestBuilderInterface> |
||||
1244 | */ |
||||
1245 | public function createRequestBuilders(): array |
||||
1246 | { |
||||
1247 | return [ |
||||
1248 | $this->createAttributesRequestBuilder(), |
||||
1249 | $this->createFilterFieldRequestBuilder(), |
||||
1250 | $this->createPaginationParameterRequestBuilder(), |
||||
1251 | $this->createSortParameterRequestBuilder(), |
||||
1252 | $this->createSparseFieldRequestBuilder(), |
||||
1253 | ]; |
||||
1254 | } |
||||
1255 | |||||
1256 | /** |
||||
1257 | * @return array<\Spryker\Glue\GlueApplication\Validator\Request\RequestValidatorInterface> |
||||
1258 | */ |
||||
1259 | public function createRequestValidators(): array |
||||
1260 | { |
||||
1261 | return [ |
||||
1262 | $this->createAcceptedFormatValidator(), |
||||
1263 | $this->createFilterRequestValidator(), |
||||
1264 | ]; |
||||
1265 | } |
||||
1266 | |||||
1267 | /** |
||||
1268 | * @return array<\Spryker\Glue\GlueApplication\Formatter\Response\ResponseFormatterInterface> |
||||
1269 | */ |
||||
1270 | public function createResponseFormatters(): array |
||||
1271 | { |
||||
1272 | return [ |
||||
1273 | $this->createDefaultResponseFormatter(), |
||||
1274 | ]; |
||||
1275 | } |
||||
1276 | |||||
1277 | /** |
||||
1278 | * @return \Spryker\Glue\GlueApplication\ContentNegotiator\ContentNegotiatorInterface |
||||
1279 | */ |
||||
1280 | public function createContentNegotiator(): ContentNegotiatorInterface |
||||
1281 | { |
||||
1282 | return new ContentNegotiator( |
||||
1283 | $this->getConventionPlugins(), |
||||
1284 | $this->getResponseEncoderStrategies(), |
||||
1285 | ); |
||||
1286 | } |
||||
1287 | |||||
1288 | /** |
||||
1289 | * @return \Spryker\Glue\GlueApplication\Validator\Request\RequestValidatorInterface |
||||
1290 | */ |
||||
1291 | public function createFilterRequestValidator(): RequestRequestValidatorInterface |
||||
1292 | { |
||||
1293 | return new FilterRequestValidator(); |
||||
1294 | } |
||||
1295 | |||||
1296 | /** |
||||
1297 | * @return \Spryker\Glue\GlueApplication\Dependency\Service\GlueApplicationToLocaleServiceInterface |
||||
1298 | */ |
||||
1299 | public function getLocaleService(): GlueApplicationToLocaleServiceInterface |
||||
1300 | { |
||||
1301 | return $this->getProvidedDependency(GlueApplicationDependencyProvider::SERVICE_LOCALE); |
||||
1302 | } |
||||
1303 | } |
||||
1304 |