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\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->registerSingleton(
184            \Apie\Common\Wrappers\PolicyManagerFactory::class,
185            function ($app) {
186                return new \Apie\Common\Wrappers\PolicyManagerFactory(
187                    $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\PolicyManagerFactory::class, 0),
188                    $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\PolicyManagerFactory::class, 1),
189                    false,
190                    $app
191                );
192            }
193        );
194        $this->registerSingleton(
195            \Apie\Core\Policies\PolicyManager::class,
196            function ($app) {
197                return $this->app->make(\Apie\Common\Wrappers\PolicyManagerFactory::class)->create(
198                
199                );
200                
201            }
202        );
203        \Apie\ServiceProviderGenerator\TagMap::register(
204            $this->app,
205            \Apie\Core\Policies\PolicyManager::class,
206            array(
207              0 => 'apie.context',
208            )
209        );
210        $this->app->tag([\Apie\Core\Policies\PolicyManager::class], 'apie.context');
211        $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider');
212        
213        $this->registerSingleton(
214            'apie.route_definitions.provider',
215            function ($app) {
216                return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider(
217                    $this->getTaggedServicesIterator('apie.common.route_definition')
218                );
219                
220            }
221        );
222        $this->registerSingleton(
223            \Apie\Common\ErrorHandler\ApiErrorRenderer::class,
224            function ($app) {
225                return new \Apie\Common\ErrorHandler\ApiErrorRenderer(
226                
227                );
228            }
229        );
230        $this->registerSingleton(
231            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
232            function ($app) {
233                return new \Apie\Common\ContextBuilders\ServiceContextBuilder(
234                    $this->getTaggedServicesServiceLocator('apie.context')
235                );
236            }
237        );
238        \Apie\ServiceProviderGenerator\TagMap::register(
239            $this->app,
240            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
241            array(
242              0 => 'apie.core.context_builder',
243            )
244        );
245        $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder');
246        $this->registerSingleton(
247            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
248            function ($app) {
249                return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder(
250                    $app->make(\Psr\Log\LoggerInterface::class)
251                );
252            }
253        );
254        \Apie\ServiceProviderGenerator\TagMap::register(
255            $this->app,
256            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
257            array(
258              0 =>
259              array(
260                'name' => 'apie.core.context_builder',
261                'priority' => -1,
262              ),
263            )
264        );
265        $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder');
266        $this->registerSingleton(
267            \Apie\Common\Events\AddAuthenticationCookie::class,
268            function ($app) {
269                return new \Apie\Common\Events\AddAuthenticationCookie(
270                
271                );
272            }
273        );
274        \Apie\ServiceProviderGenerator\TagMap::register(
275            $this->app,
276            \Apie\Common\Events\AddAuthenticationCookie::class,
277            array(
278              0 => 'kernel.event_subscriber',
279            )
280        );
281        $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber');
282        $this->registerSingleton(
283            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
284            function ($app) {
285                return new \Apie\Common\ContextBuilders\AddLockManagerContextBuilder(
286                    $app->make(\Symfony\Component\Lock\LockFactory::class)
287                );
288            }
289        );
290        \Apie\ServiceProviderGenerator\TagMap::register(
291            $this->app,
292            \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class,
293            array(
294              0 => 'apie.core.context_builder',
295            )
296        );
297        $this->app->tag([\Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class], 'apie.core.context_builder');
298        $this->app->singleton(
299            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
300            function ($app) {
301                return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer(
302                    $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class),
303                    $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class)
304                );
305            }
306        );
307        \Apie\ServiceProviderGenerator\TagMap::register(
308            $this->app,
309            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
310            array(
311              0 => 'apie.datalayer',
312              1 => 'always-singleton',
313            )
314        );
315        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer');
316        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'always-singleton');
317        $this->app->bind('apie', \Apie\Common\ApieFacade::class);
318        
319        
320    }
321}