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                );
127            }
128        );
129        $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider');
130        
131        $this->app->singleton(
132            'apie.route_definitions.provider',
133            function ($app) {
134                return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider(
135                    $this->getTaggedServicesIterator('apie.common.route_definition')
136                );
137                
138            }
139        );
140        $this->app->singleton(
141            \Apie\Common\ErrorHandler\ApiErrorRenderer::class,
142            function ($app) {
143                return new \Apie\Common\ErrorHandler\ApiErrorRenderer(
144                
145                );
146            }
147        );
148        $this->app->singleton(
149            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
150            function ($app) {
151                return new \Apie\Common\ContextBuilders\ServiceContextBuilder(
152                    $this->getTaggedServicesServiceLocator('apie.context')
153                );
154            }
155        );
156        \Apie\ServiceProviderGenerator\TagMap::register(
157            $this->app,
158            \Apie\Common\ContextBuilders\ServiceContextBuilder::class,
159            array(
160              0 => 'apie.core.context_builder',
161            )
162        );
163        $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder');
164        $this->app->singleton(
165            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
166            function ($app) {
167                return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder(
168                    $app->make(\Psr\Log\LoggerInterface::class)
169                );
170            }
171        );
172        \Apie\ServiceProviderGenerator\TagMap::register(
173            $this->app,
174            \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class,
175            array(
176              0 =>
177              array(
178                'name' => 'apie.core.context_builder',
179                'priority' => -1,
180              ),
181            )
182        );
183        $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder');
184        $this->app->singleton(
185            \Apie\Common\Events\AddAuthenticationCookie::class,
186            function ($app) {
187                return new \Apie\Common\Events\AddAuthenticationCookie(
188                
189                );
190            }
191        );
192        \Apie\ServiceProviderGenerator\TagMap::register(
193            $this->app,
194            \Apie\Common\Events\AddAuthenticationCookie::class,
195            array(
196              0 => 'kernel.event_subscriber',
197            )
198        );
199        $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber');
200        $this->app->singleton(
201            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
202            function ($app) {
203                return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer(
204                    $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class),
205                    $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class)
206                );
207            }
208        );
209        \Apie\ServiceProviderGenerator\TagMap::register(
210            $this->app,
211            \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class,
212            array(
213              0 => 'apie.datalayer',
214            )
215        );
216        $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer');
217        $this->app->bind('apie', \Apie\Common\ApieFacade::class);
218        
219        
220    }
221}