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                
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\ApieFacade::class,
97            function ($app) {
98                return new \Apie\Common\ApieFacade(
99                    $app->make('apie.route_definitions.provider'),
100                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
101                    $app->make(\Apie\Serializer\Serializer::class),
102                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class)
103                );
104            }
105        );
106        \Apie\ServiceProviderGenerator\TagMap::register(
107            $this->app,
108            \Apie\Common\ApieFacade::class,
109            array(
110              0 => 'apie.context',
111            )
112        );
113        $this->app->tag([\Apie\Common\ApieFacade::class], 'apie.context');
114        $this->registerSingleton(
115            \Apie\Common\LoginService::class,
116            function ($app) {
117                return new \Apie\Common\LoginService(
118                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
119                    $app->make(\Apie\Common\ActionDefinitionProvider::class),
120                    $app->make(\Apie\Serializer\Serializer::class)
121                );
122            }
123        );
124        \Apie\ServiceProviderGenerator\TagMap::register(
125            $this->app,
126            \Apie\Common\LoginService::class,
127            array(
128              0 => 'apie.context',
129            )
130        );
131        $this->app->tag([\Apie\Common\LoginService::class], 'apie.context');
132        $this->registerSingleton(
133            \Apie\Common\Events\ResponseDispatcher::class,
134            function ($app) {
135                return new \Apie\Common\Events\ResponseDispatcher(
136                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
137                );
138            }
139        );
140        $this->registerSingleton(
141            \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class,
142            function ($app) {
143                return new \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider(
144                    $this->parseArgument('%apie.cms.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 0),
145                    $this->parseArgument('%apie.rest_api.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 1)
146                );
147            }
148        );
149        $this->registerSingleton(
150            \Apie\Common\RequestBodyDecoder::class,
151            function ($app) {
152                return new \Apie\Common\RequestBodyDecoder(
153                    $app->make(\Apie\Serializer\DecoderHashmap::class)
154                );
155            }
156        );
157        $this->registerSingleton(
158            \Apie\Common\Events\AddAuditLog::class,
159            function ($app) {
160                return new \Apie\Common\Events\AddAuditLog(
161                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class)
162                );
163            }
164        );
165        \Apie\ServiceProviderGenerator\TagMap::register(
166            $this->app,
167            \Apie\Common\Events\AddAuditLog::class,
168            array(
169              0 => 'kernel.event_subscriber',
170            )
171        );
172        $this->app->tag([\Apie\Common\Events\AddAuditLog::class], 'kernel.event_subscriber');
173        $this->registerSingleton(
174            'apie.bounded_context.hashmap_factory',
175            function ($app) {
176                return new \Apie\Common\Wrappers\BoundedContextHashmapFactory(
177                    $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 0),
178                    $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 1),
179                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
180                );
181            }
182        );
183        $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider');
184        
185        $this->registerSingleton(
186            'apie.route_definitions.provider',
187            function ($app) {
188                return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider(
189                    $this->getTaggedServicesIterator('apie.common.route_definition')
190                );
191                
192            }
193        );
194        $this->registerSingleton(
195            \Apie\Common\ErrorHandler\ApiErrorRenderer::class,
196            function ($app) {
197                return new \Apie\Common\ErrorHandler\ApiErrorRenderer(
198                
199                );
200            }
201        );
202        $this->registerSingleton(
203            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
204            function ($app) {
205                return new \Apie\Common\ContextBuilders\ServiceContextBuilder(
206                    $this->getTaggedServicesServiceLocator('apie.context')
207                );
208            }
209        );
210        \Apie\ServiceProviderGenerator\TagMap::register(
211            $this->app,
212            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
213            array(
214              0 => 'apie.core.context_builder',
215            )
216        );
217        $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder');
218        $this->registerSingleton(
219            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
220            function ($app) {
221                return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder(
222                    $app->make(\Psr\Log\LoggerInterface::class)
223                );
224            }
225        );
226        \Apie\ServiceProviderGenerator\TagMap::register(
227            $this->app,
228            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
229            array(
230              0 =>
231              array(
232                'name' => 'apie.core.context_builder',
233                'priority' => -1,
234              ),
235            )
236        );
237        $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder');
238        $this->registerSingleton(
239            \Apie\Common\Events\AddAuthenticationCookie::class,
240            function ($app) {
241                return new \Apie\Common\Events\AddAuthenticationCookie(
242                
243                );
244            }
245        );
246        \Apie\ServiceProviderGenerator\TagMap::register(
247            $this->app,
248            \Apie\Common\Events\AddAuthenticationCookie::class,
249            array(
250              0 => 'kernel.event_subscriber',
251            )
252        );
253        $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber');
254        $this->registerSingleton(
255            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
256            function ($app) {
257                return new \Apie\Common\ContextBuilders\AddLockManagerContextBuilder(
258                    $app->make(\Symfony\Component\Lock\LockFactory::class)
259                );
260            }
261        );
262        \Apie\ServiceProviderGenerator\TagMap::register(
263            $this->app,
264            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
265            array(
266              0 => 'apie.core.context_builder',
267            )
268        );
269        $this->app->tag([\Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class], 'apie.core.context_builder');
270        $this->app->singleton(
271            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
272            function ($app) {
273                return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer(
274                    $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class),
275                    $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class)
276                );
277            }
278        );
279        \Apie\ServiceProviderGenerator\TagMap::register(
280            $this->app,
281            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
282            array(
283              0 => 'apie.datalayer',
284              1 => 'always-singleton',
285            )
286        );
287        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer');
288        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'always-singleton');
289        $this->app->bind('apie', \Apie\Common\ApieFacade::class);
290        
291        
292    }
293}