Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
CommonServiceProvider
n/a
0 / 0
n/a
0 / 0
1
n/a
0 / 0
 register
n/a
0 / 0
n/a
0 / 0
1
1<?php
2namespace Apie\Common;
3
4use Apie\ServiceProviderGenerator\UseGeneratedMethods;
5use Illuminate\Support\ServiceProvider;
6
7/**
8 * This file is generated with apie/service-provider-generator from file: common.yaml
9 * @codeCoverageIgnore
10 */
11class CommonServiceProvider extends ServiceProvider
12{
13    use UseGeneratedMethods;
14
15    public function register()
16    {
17        $this->registerSingleton(
18            \Apie\Common\ActionDefinitionProvider::class,
19            function ($app) {
20                return new \Apie\Common\ActionDefinitionProvider(
21                    $this->getTaggedServicesServiceLocator('apie.context')
22                );
23            }
24        );
25        $this->registerSingleton(
26            \Apie\Common\ContextBuilders\AddEventDispatcherContextBuilder::class,
27            function ($app) {
28                return new \Apie\Common\ContextBuilders\AddEventDispatcherContextBuilder(
29                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
30                );
31            }
32        );
33        \Apie\ServiceProviderGenerator\TagMap::register(
34            $this->app,
35            \Apie\Common\ContextBuilders\AddEventDispatcherContextBuilder::class,
36            array(
37              0 => 'apie.core.context_builder',
38            )
39        );
40        $this->app->tag([\Apie\Common\ContextBuilders\AddEventDispatcherContextBuilder::class], 'apie.core.context_builder');
41        $this->registerSingleton(
42            \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class,
43            function ($app) {
44                return new \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder(
45                    $app->make(\Psr\Cache\CacheItemPoolInterface::class),
46                    $app->make(\Psr\Log\LoggerInterface::class),
47                    $this->parseArgument('%apie.encryption_key%', \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class, 2)
48                );
49            }
50        );
51        \Apie\ServiceProviderGenerator\TagMap::register(
52            $this->app,
53            \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class,
54            array(
55              0 => 'apie.core.context_builder',
56            )
57        );
58        $this->app->tag([\Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class], 'apie.core.context_builder');
59        $this->registerSingleton(
60            \Apie\Common\Command\ApieUpdateRecalculatingCommand::class,
61            function ($app) {
62                return new \Apie\Common\Command\ApieUpdateRecalculatingCommand(
63                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
64                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class),
65                    $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class)
66                );
67            }
68        );
69        \Apie\ServiceProviderGenerator\TagMap::register(
70            $this->app,
71            \Apie\Common\Command\ApieUpdateRecalculatingCommand::class,
72            array(
73              0 => 'console.command',
74            )
75        );
76        $this->app->tag([\Apie\Common\Command\ApieUpdateRecalculatingCommand::class], 'console.command');
77        $this->registerSingleton(
78            \Apie\Common\Command\ApieAuditLogForMigrationCommand::class,
79            function ($app) {
80                return new \Apie\Common\Command\ApieAuditLogForMigrationCommand(
81                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
82                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class),
83                    $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class)
84                );
85            }
86        );
87        \Apie\ServiceProviderGenerator\TagMap::register(
88            $this->app,
89            \Apie\Common\Command\ApieAuditLogForMigrationCommand::class,
90            array(
91              0 => 'console.command',
92            )
93        );
94        $this->app->tag([\Apie\Common\Command\ApieAuditLogForMigrationCommand::class], 'console.command');
95        $this->registerSingleton(
96            \Apie\Common\Command\ApieMakeTranslationFileCommand::class,
97            function ($app) {
98                return new \Apie\Common\Command\ApieMakeTranslationFileCommand(
99                    $app->make(\Apie\Common\Translator\TranslationCollector::class),
100                    $app->make(\Apie\Core\Other\FileWriterInterface::class)
101                );
102            }
103        );
104        \Apie\ServiceProviderGenerator\TagMap::register(
105            $this->app,
106            \Apie\Common\Command\ApieMakeTranslationFileCommand::class,
107            array(
108              0 => 'console.command',
109            )
110        );
111        $this->app->tag([\Apie\Common\Command\ApieMakeTranslationFileCommand::class], 'console.command');
112        $this->registerSingleton(
113            \Apie\Common\ApieFacade::class,
114            function ($app) {
115                return new \Apie\Common\ApieFacade(
116                    $app->make('apie.route_definitions.provider'),
117                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
118                    $app->make(\Apie\Serializer\Serializer::class),
119                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class)
120                );
121            }
122        );
123        \Apie\ServiceProviderGenerator\TagMap::register(
124            $this->app,
125            \Apie\Common\ApieFacade::class,
126            array(
127              0 => 'apie.context',
128            )
129        );
130        $this->app->tag([\Apie\Common\ApieFacade::class], 'apie.context');
131        $this->registerSingleton(
132            \Apie\Common\LoginService::class,
133            function ($app) {
134                return new \Apie\Common\LoginService(
135                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
136                    $app->make(\Apie\Common\ActionDefinitionProvider::class),
137                    $app->make(\Apie\Serializer\Serializer::class)
138                );
139            }
140        );
141        \Apie\ServiceProviderGenerator\TagMap::register(
142            $this->app,
143            \Apie\Common\LoginService::class,
144            array(
145              0 => 'apie.context',
146            )
147        );
148        $this->app->tag([\Apie\Common\LoginService::class], 'apie.context');
149        $this->registerSingleton(
150            \Apie\Common\Translator\TranslationCollector::class,
151            function ($app) {
152                return \Apie\Common\Translator\TranslationCollector::create(
153                    $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class),
154                    $this->getTaggedServicesIterator('apie.translation_collector')
155                );
156                
157            }
158        );
159        $this->registerSingleton(
160            \Apie\Common\Translator\ResourceNameTranslationProvider::class,
161            function ($app) {
162                return new \Apie\Common\Translator\ResourceNameTranslationProvider(
163                
164                );
165            }
166        );
167        \Apie\ServiceProviderGenerator\TagMap::register(
168            $this->app,
169            \Apie\Common\Translator\ResourceNameTranslationProvider::class,
170            array(
171              0 => 'apie.translation_collector',
172            )
173        );
174        $this->app->tag([\Apie\Common\Translator\ResourceNameTranslationProvider::class], 'apie.translation_collector');
175        $this->registerSingleton(
176            \Apie\Common\Translator\ReadAttributeTranslationProvider::class,
177            function ($app) {
178                return new \Apie\Common\Translator\ReadAttributeTranslationProvider(
179                
180                );
181            }
182        );
183        \Apie\ServiceProviderGenerator\TagMap::register(
184            $this->app,
185            \Apie\Common\Translator\ReadAttributeTranslationProvider::class,
186            array(
187              0 => 'apie.translation_collector',
188            )
189        );
190        $this->app->tag([\Apie\Common\Translator\ReadAttributeTranslationProvider::class], 'apie.translation_collector');
191        $this->registerSingleton(
192            \Apie\Common\Translator\ResourceActionTranslationProvider::class,
193            function ($app) {
194                return new \Apie\Common\Translator\ResourceActionTranslationProvider(
195                    $app->make(\Apie\Common\ActionDefinitionProvider::class)
196                );
197            }
198        );
199        \Apie\ServiceProviderGenerator\TagMap::register(
200            $this->app,
201            \Apie\Common\Translator\ResourceActionTranslationProvider::class,
202            array(
203              0 => 'apie.translation_collector',
204            )
205        );
206        $this->app->tag([\Apie\Common\Translator\ResourceActionTranslationProvider::class], 'apie.translation_collector');
207        $this->registerSingleton(
208            \Apie\Common\Events\ResponseDispatcher::class,
209            function ($app) {
210                return new \Apie\Common\Events\ResponseDispatcher(
211                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
212                );
213            }
214        );
215        $this->registerSingleton(
216            \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class,
217            function ($app) {
218                return new \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider(
219                    $this->parseArgument('%apie.cms.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 0),
220                    $this->parseArgument('%apie.rest_api.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 1)
221                );
222            }
223        );
224        $this->registerSingleton(
225            \Apie\Common\RequestBodyDecoder::class,
226            function ($app) {
227                return new \Apie\Common\RequestBodyDecoder(
228                    $app->make(\Apie\Serializer\DecoderHashmap::class)
229                );
230            }
231        );
232        $this->registerSingleton(
233            \Apie\Common\Events\AddAuditLog::class,
234            function ($app) {
235                return new \Apie\Common\Events\AddAuditLog(
236                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class)
237                );
238            }
239        );
240        \Apie\ServiceProviderGenerator\TagMap::register(
241            $this->app,
242            \Apie\Common\Events\AddAuditLog::class,
243            array(
244              0 => 'kernel.event_subscriber',
245            )
246        );
247        $this->app->tag([\Apie\Common\Events\AddAuditLog::class], 'kernel.event_subscriber');
248        $this->registerSingleton(
249            'apie.bounded_context.hashmap_factory',
250            function ($app) {
251                return new \Apie\Common\Wrappers\BoundedContextHashmapFactory(
252                    $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 0),
253                    $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 1),
254                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
255                );
256            }
257        );
258        $this->registerSingleton(
259            \Apie\Common\Wrappers\PolicyManagerFactory::class,
260            function ($app) {
261                return new \Apie\Common\Wrappers\PolicyManagerFactory(
262                    $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\PolicyManagerFactory::class, 0),
263                    $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\PolicyManagerFactory::class, 1),
264                    false,
265                    $app
266                );
267            }
268        );
269        $this->registerSingleton(
270            \Apie\Core\Policies\PolicyManager::class,
271            function ($app) {
272                return $this->app->make(\Apie\Common\Wrappers\PolicyManagerFactory::class)->create(
273                
274                );
275                
276            }
277        );
278        \Apie\ServiceProviderGenerator\TagMap::register(
279            $this->app,
280            \Apie\Core\Policies\PolicyManager::class,
281            array(
282              0 => 'apie.context',
283            )
284        );
285        $this->app->tag([\Apie\Core\Policies\PolicyManager::class], 'apie.context');
286        $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider');
287        
288        $this->registerSingleton(
289            'apie.route_definitions.provider',
290            function ($app) {
291                return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider(
292                    $this->getTaggedServicesIterator('apie.common.route_definition')
293                );
294                
295            }
296        );
297        $this->registerSingleton(
298            \Apie\Common\ErrorHandler\ApiErrorRenderer::class,
299            function ($app) {
300                return new \Apie\Common\ErrorHandler\ApiErrorRenderer(
301                
302                );
303            }
304        );
305        $this->registerSingleton(
306            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
307            function ($app) {
308                return new \Apie\Common\ContextBuilders\ServiceContextBuilder(
309                    $this->getTaggedServicesServiceLocator('apie.context')
310                );
311            }
312        );
313        \Apie\ServiceProviderGenerator\TagMap::register(
314            $this->app,
315            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
316            array(
317              0 => 'apie.core.context_builder',
318            )
319        );
320        $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder');
321        $this->registerSingleton(
322            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
323            function ($app) {
324                return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder(
325                    $app->make(\Psr\Log\LoggerInterface::class)
326                );
327            }
328        );
329        \Apie\ServiceProviderGenerator\TagMap::register(
330            $this->app,
331            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
332            array(
333              0 =>
334              array(
335                'name' => 'apie.core.context_builder',
336                'priority' => -1,
337              ),
338            )
339        );
340        $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder');
341        $this->registerSingleton(
342            \Apie\Common\Events\AddAuthenticationCookie::class,
343            function ($app) {
344                return new \Apie\Common\Events\AddAuthenticationCookie(
345                
346                );
347            }
348        );
349        \Apie\ServiceProviderGenerator\TagMap::register(
350            $this->app,
351            \Apie\Common\Events\AddAuthenticationCookie::class,
352            array(
353              0 => 'kernel.event_subscriber',
354            )
355        );
356        $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber');
357        $this->registerSingleton(
358            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
359            function ($app) {
360                return new \Apie\Common\ContextBuilders\AddLockManagerContextBuilder(
361                    $app->make(\Symfony\Component\Lock\LockFactory::class)
362                );
363            }
364        );
365        \Apie\ServiceProviderGenerator\TagMap::register(
366            $this->app,
367            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
368            array(
369              0 => 'apie.core.context_builder',
370            )
371        );
372        $this->app->tag([\Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class], 'apie.core.context_builder');
373        $this->registerSingleton(
374            \Apie\Common\ContextBuilders\LocaleContextBuilder::class,
375            function ($app) {
376                return new \Apie\Common\ContextBuilders\LocaleContextBuilder(
377                    $this->parseArgument('%apie.language_typehint%', \Apie\Common\ContextBuilders\LocaleContextBuilder::class, 0)
378                );
379            }
380        );
381        \Apie\ServiceProviderGenerator\TagMap::register(
382            $this->app,
383            \Apie\Common\ContextBuilders\LocaleContextBuilder::class,
384            array(
385              0 => 'apie.core.context_builder',
386            )
387        );
388        $this->app->tag([\Apie\Common\ContextBuilders\LocaleContextBuilder::class], 'apie.core.context_builder');
389        $this->app->singleton(
390            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
391            function ($app) {
392                return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer(
393                    $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class),
394                    $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class)
395                );
396            }
397        );
398        \Apie\ServiceProviderGenerator\TagMap::register(
399            $this->app,
400            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
401            array(
402              0 => 'apie.datalayer',
403              1 => 'always-singleton',
404            )
405        );
406        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer');
407        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'always-singleton');
408        $this->app->bind('apie', \Apie\Common\ApieFacade::class);
409        
410        
411    }
412}