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 |
| 2 | namespace Apie\Common; |
| 3 | |
| 4 | use Apie\ServiceProviderGenerator\UseGeneratedMethods; |
| 5 | use Illuminate\Support\ServiceProvider; |
| 6 | |
| 7 | /** |
| 8 | * This file is generated with apie/service-provider-generator from file: common.yaml |
| 9 | * @codeCoverageIgnore |
| 10 | */ |
| 11 | class 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 | $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->app->singleton( |
| 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->app->singleton( |
| 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->app->singleton( |
| 97 | \Apie\Common\Events\ResponseDispatcher::class, |
| 98 | function ($app) { |
| 99 | return new \Apie\Common\Events\ResponseDispatcher( |
| 100 | $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class) |
| 101 | ); |
| 102 | } |
| 103 | ); |
| 104 | $this->app->singleton( |
| 105 | \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, |
| 106 | function ($app) { |
| 107 | return new \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider( |
| 108 | $this->parseArgument('%apie.cms.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 0), |
| 109 | $this->parseArgument('%apie.rest_api.base_url%', \Apie\Common\RouteDefinitions\PossibleRoutePrefixProvider::class, 1) |
| 110 | ); |
| 111 | } |
| 112 | ); |
| 113 | $this->app->singleton( |
| 114 | \Apie\Common\RequestBodyDecoder::class, |
| 115 | function ($app) { |
| 116 | return new \Apie\Common\RequestBodyDecoder( |
| 117 | $app->make(\Apie\Serializer\DecoderHashmap::class) |
| 118 | ); |
| 119 | } |
| 120 | ); |
| 121 | $this->app->singleton( |
| 122 | 'apie.bounded_context.hashmap_factory', |
| 123 | function ($app) { |
| 124 | return new \Apie\Common\Wrappers\BoundedContextHashmapFactory( |
| 125 | $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 0), |
| 126 | $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 1), |
| 127 | $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class) |
| 128 | ); |
| 129 | } |
| 130 | ); |
| 131 | $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider'); |
| 132 | |
| 133 | $this->app->singleton( |
| 134 | 'apie.route_definitions.provider', |
| 135 | function ($app) { |
| 136 | return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider( |
| 137 | $this->getTaggedServicesIterator('apie.common.route_definition') |
| 138 | ); |
| 139 | |
| 140 | } |
| 141 | ); |
| 142 | $this->app->singleton( |
| 143 | \Apie\Common\ErrorHandler\ApiErrorRenderer::class, |
| 144 | function ($app) { |
| 145 | return new \Apie\Common\ErrorHandler\ApiErrorRenderer( |
| 146 | |
| 147 | ); |
| 148 | } |
| 149 | ); |
| 150 | $this->app->singleton( |
| 151 | \Apie\Common\ContextBuilders\ServiceContextBuilder::class, |
| 152 | function ($app) { |
| 153 | return new \Apie\Common\ContextBuilders\ServiceContextBuilder( |
| 154 | $this->getTaggedServicesServiceLocator('apie.context') |
| 155 | ); |
| 156 | } |
| 157 | ); |
| 158 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 159 | $this->app, |
| 160 | \Apie\Common\ContextBuilders\ServiceContextBuilder::class, |
| 161 | array( |
| 162 | 0 => 'apie.core.context_builder', |
| 163 | ) |
| 164 | ); |
| 165 | $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder'); |
| 166 | $this->app->singleton( |
| 167 | \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class, |
| 168 | function ($app) { |
| 169 | return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder( |
| 170 | $app->make(\Psr\Log\LoggerInterface::class) |
| 171 | ); |
| 172 | } |
| 173 | ); |
| 174 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 175 | $this->app, |
| 176 | \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class, |
| 177 | array( |
| 178 | 0 => |
| 179 | array( |
| 180 | 'name' => 'apie.core.context_builder', |
| 181 | 'priority' => -1, |
| 182 | ), |
| 183 | ) |
| 184 | ); |
| 185 | $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder'); |
| 186 | $this->app->singleton( |
| 187 | \Apie\Common\Events\AddAuthenticationCookie::class, |
| 188 | function ($app) { |
| 189 | return new \Apie\Common\Events\AddAuthenticationCookie( |
| 190 | |
| 191 | ); |
| 192 | } |
| 193 | ); |
| 194 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 195 | $this->app, |
| 196 | \Apie\Common\Events\AddAuthenticationCookie::class, |
| 197 | array( |
| 198 | 0 => 'kernel.event_subscriber', |
| 199 | ) |
| 200 | ); |
| 201 | $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber'); |
| 202 | $this->app->singleton( |
| 203 | \Apie\Common\Events\AddSharedResources::class, |
| 204 | function ($app) { |
| 205 | return new \Apie\Common\Events\AddSharedResources( |
| 206 | |
| 207 | ); |
| 208 | } |
| 209 | ); |
| 210 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 211 | $this->app, |
| 212 | \Apie\Common\Events\AddSharedResources::class, |
| 213 | array( |
| 214 | 0 => 'kernel.event_subscriber', |
| 215 | ) |
| 216 | ); |
| 217 | $this->app->tag([\Apie\Common\Events\AddSharedResources::class], 'kernel.event_subscriber'); |
| 218 | $this->app->singleton( |
| 219 | \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class, |
| 220 | function ($app) { |
| 221 | return new \Apie\Common\ContextBuilders\AddLockManagerContextBuilder( |
| 222 | $app->make(\Symfony\Component\Lock\LockFactory::class) |
| 223 | ); |
| 224 | } |
| 225 | ); |
| 226 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 227 | $this->app, |
| 228 | \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class, |
| 229 | array( |
| 230 | 0 => 'apie.core.context_builder', |
| 231 | ) |
| 232 | ); |
| 233 | $this->app->tag([\Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class], 'apie.core.context_builder'); |
| 234 | $this->app->singleton( |
| 235 | \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class, |
| 236 | function ($app) { |
| 237 | return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer( |
| 238 | $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class), |
| 239 | $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class) |
| 240 | ); |
| 241 | } |
| 242 | ); |
| 243 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 244 | $this->app, |
| 245 | \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class, |
| 246 | array( |
| 247 | 0 => 'apie.datalayer', |
| 248 | ) |
| 249 | ); |
| 250 | $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer'); |
| 251 | $this->app->bind('apie', \Apie\Common\ApieFacade::class); |
| 252 | |
| 253 | |
| 254 | } |
| 255 | } |