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