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->app->singleton(
18            \Apie\Common\ActionDefinitionProvider::class,
19            function ($app) {
20                return new \Apie\Common\ActionDefinitionProvider(
21                
22                );
23            }
24        );
25        $this->app->singleton(
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->app->singleton(
42            \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class,
43            function ($app) {
44                return new \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder(
45                    $app->make(\Psr\Cache\CacheItemPoolInterface::class),
46                    $this->parseArgument('%apie.encryption_key%')
47                );
48            }
49        );
50        \Apie\ServiceProviderGenerator\TagMap::register(
51            $this->app,
52            \Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class,
53            array(
54              0 => 'apie.core.context_builder',
55            )
56        );
57        $this->app->tag([\Apie\Common\ContextBuilders\AddTextEncrypterContextBuilder::class], 'apie.core.context_builder');
58        $this->app->singleton(
59            \Apie\Common\Command\ApieUpdateRecalculatingCommand::class,
60            function ($app) {
61                return new \Apie\Common\Command\ApieUpdateRecalculatingCommand(
62                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
63                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class),
64                    $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class)
65                );
66            }
67        );
68        \Apie\ServiceProviderGenerator\TagMap::register(
69            $this->app,
70            \Apie\Common\Command\ApieUpdateRecalculatingCommand::class,
71            array(
72              0 => 'console.command',
73            )
74        );
75        $this->app->tag([\Apie\Common\Command\ApieUpdateRecalculatingCommand::class], 'console.command');
76        $this->app->singleton(
77            \Apie\Common\ApieFacade::class,
78            function ($app) {
79                return new \Apie\Common\ApieFacade(
80                    $app->make('apie.route_definitions.provider'),
81                    $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class),
82                    $app->make(\Apie\Serializer\Serializer::class),
83                    $app->make(\Apie\Core\Datalayers\ApieDatalayer::class)
84                );
85            }
86        );
87        \Apie\ServiceProviderGenerator\TagMap::register(
88            $this->app,
89            \Apie\Common\ApieFacade::class,
90            array(
91              0 => 'apie.context',
92            )
93        );
94        $this->app->tag([\Apie\Common\ApieFacade::class], 'apie.context');
95        $this->app->singleton(
96            \Apie\Common\Events\ResponseDispatcher::class,
97            function ($app) {
98                return new \Apie\Common\Events\ResponseDispatcher(
99                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
100                );
101            }
102        );
103        $this->app->singleton(
104            \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class,
105            function ($app) {
106                return new \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider(
107                    $this->parseArgument('%apie.cms.base_url%'),
108                    $this->parseArgument('%apie.rest_api.base_url%')
109                );
110            }
111        );
112        $this->app->singleton(
113            \Apie\Common\RequestBodyDecoder::class,
114            function ($app) {
115                return new \Apie\Common\RequestBodyDecoder(
116                    $app->make(\Apie\Serializer\DecoderHashmap::class)
117                );
118            }
119        );
120        $this->app->singleton(
121            'apie.bounded_context.hashmap_factory',
122            function ($app) {
123                return new \Apie\Common\Wrappers\BoundedContextHashmapFactory(
124                    $this->parseArgument('%apie.bounded_contexts%'),
125                    $this->parseArgument('%apie.scan_bounded_contexts%'),
126                    $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class)
127                );
128            }
129        );
130        $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider');
131        
132        $this->app->singleton(
133            'apie.route_definitions.provider',
134            function ($app) {
135                return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider(
136                    $this->getTaggedServicesIterator('apie.common.route_definition')
137                );
138                
139            }
140        );
141        $this->app->singleton(
142            \Apie\Common\ErrorHandler\ApiErrorRenderer::class,
143            function ($app) {
144                return new \Apie\Common\ErrorHandler\ApiErrorRenderer(
145                
146                );
147            }
148        );
149        $this->app->singleton(
150            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
151            function ($app) {
152                return new \Apie\Common\ContextBuilders\ServiceContextBuilder(
153                    $this->getTaggedServicesServiceLocator('apie.context')
154                );
155            }
156        );
157        \Apie\ServiceProviderGenerator\TagMap::register(
158            $this->app,
159            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
160            array(
161              0 => 'apie.core.context_builder',
162            )
163        );
164        $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder');
165        $this->app->singleton(
166            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
167            function ($app) {
168                return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder(
169                    $app->make(\Psr\Log\LoggerInterface::class)
170                );
171            }
172        );
173        \Apie\ServiceProviderGenerator\TagMap::register(
174            $this->app,
175            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
176            array(
177              0 =>
178              array(
179                'name' => 'apie.core.context_builder',
180                'priority' => -1,
181              ),
182            )
183        );
184        $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder');
185        $this->app->singleton(
186            \Apie\Common\Events\AddAuthenticationCookie::class,
187            function ($app) {
188                return new \Apie\Common\Events\AddAuthenticationCookie(
189                
190                );
191            }
192        );
193        \Apie\ServiceProviderGenerator\TagMap::register(
194            $this->app,
195            \Apie\Common\Events\AddAuthenticationCookie::class,
196            array(
197              0 => 'kernel.event_subscriber',
198            )
199        );
200        $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber');
201        $this->app->singleton(
202            \Apie\Common\Events\AddSharedResources::class,
203            function ($app) {
204                return new \Apie\Common\Events\AddSharedResources(
205                
206                );
207            }
208        );
209        \Apie\ServiceProviderGenerator\TagMap::register(
210            $this->app,
211            \Apie\Common\Events\AddSharedResources::class,
212            array(
213              0 => 'kernel.event_subscriber',
214            )
215        );
216        $this->app->tag([\Apie\Common\Events\AddSharedResources::class], 'kernel.event_subscriber');
217        $this->app->singleton(
218            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
219            function ($app) {
220                return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer(
221                    $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class),
222                    $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class)
223                );
224            }
225        );
226        \Apie\ServiceProviderGenerator\TagMap::register(
227            $this->app,
228            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
229            array(
230              0 => 'apie.datalayer',
231            )
232        );
233        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer');
234        $this->app->bind('apie', \Apie\Common\ApieFacade::class);
235        
236        
237    }
238}