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\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->app->singleton( |
| 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->app->singleton( |
| 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->app->singleton( |
| 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->app->singleton( |
| 140 | 'apie.bounded_context.hashmap_factory', |
| 141 | function ($app) { |
| 142 | return new \Apie\Common\Wrappers\BoundedContextHashmapFactory( |
| 143 | $this->parseArgument('%apie.bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 0), |
| 144 | $this->parseArgument('%apie.scan_bounded_contexts%', \Apie\Common\Wrappers\BoundedContextHashmapFactory::class, 1), |
| 145 | $app->make(\Psr\EventDispatcher\EventDispatcherInterface::class) |
| 146 | ); |
| 147 | } |
| 148 | ); |
| 149 | $this->app->bind(\Apie\Common\Interfaces\RouteDefinitionProviderInterface::class, 'apie.route_definitions.provider'); |
| 150 | |
| 151 | $this->app->singleton( |
| 152 | 'apie.route_definitions.provider', |
| 153 | function ($app) { |
| 154 | return \Apie\Common\Wrappers\GeneralServiceFactory::createRoutedDefinitionProvider( |
| 155 | $this->getTaggedServicesIterator('apie.common.route_definition') |
| 156 | ); |
| 157 | |
| 158 | } |
| 159 | ); |
| 160 | $this->app->singleton( |
| 161 | \Apie\Common\ErrorHandler\ApiErrorRenderer::class, |
| 162 | function ($app) { |
| 163 | return new \Apie\Common\ErrorHandler\ApiErrorRenderer( |
| 164 | |
| 165 | ); |
| 166 | } |
| 167 | ); |
| 168 | $this->app->singleton( |
| 169 | \Apie\Common\ContextBuilders\ServiceContextBuilder::class, |
| 170 | function ($app) { |
| 171 | return new \Apie\Common\ContextBuilders\ServiceContextBuilder( |
| 172 | $this->getTaggedServicesServiceLocator('apie.context') |
| 173 | ); |
| 174 | } |
| 175 | ); |
| 176 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 177 | $this->app, |
| 178 | \Apie\Common\ContextBuilders\ServiceContextBuilder::class, |
| 179 | array( |
| 180 | 0 => 'apie.core.context_builder', |
| 181 | ) |
| 182 | ); |
| 183 | $this->app->tag([\Apie\Common\ContextBuilders\ServiceContextBuilder::class], 'apie.core.context_builder'); |
| 184 | $this->app->singleton( |
| 185 | \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class, |
| 186 | function ($app) { |
| 187 | return new \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder( |
| 188 | $app->make(\Psr\Log\LoggerInterface::class) |
| 189 | ); |
| 190 | } |
| 191 | ); |
| 192 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 193 | $this->app, |
| 194 | \Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class, |
| 195 | array( |
| 196 | 0 => |
| 197 | array( |
| 198 | 'name' => 'apie.core.context_builder', |
| 199 | 'priority' => -1, |
| 200 | ), |
| 201 | ) |
| 202 | ); |
| 203 | $this->app->tag([\Apie\Common\ContextBuilders\CheckAuthenticatedContextBuilder::class], 'apie.core.context_builder'); |
| 204 | $this->app->singleton( |
| 205 | \Apie\Common\Events\AddAuthenticationCookie::class, |
| 206 | function ($app) { |
| 207 | return new \Apie\Common\Events\AddAuthenticationCookie( |
| 208 | |
| 209 | ); |
| 210 | } |
| 211 | ); |
| 212 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 213 | $this->app, |
| 214 | \Apie\Common\Events\AddAuthenticationCookie::class, |
| 215 | array( |
| 216 | 0 => 'kernel.event_subscriber', |
| 217 | ) |
| 218 | ); |
| 219 | $this->app->tag([\Apie\Common\Events\AddAuthenticationCookie::class], 'kernel.event_subscriber'); |
| 220 | $this->app->singleton( |
| 221 | \Apie\Common\Events\AddSharedResources::class, |
| 222 | function ($app) { |
| 223 | return new \Apie\Common\Events\AddSharedResources( |
| 224 | |
| 225 | ); |
| 226 | } |
| 227 | ); |
| 228 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 229 | $this->app, |
| 230 | \Apie\Common\Events\AddSharedResources::class, |
| 231 | array( |
| 232 | 0 => 'kernel.event_subscriber', |
| 233 | ) |
| 234 | ); |
| 235 | $this->app->tag([\Apie\Common\Events\AddSharedResources::class], 'kernel.event_subscriber'); |
| 236 | $this->app->singleton( |
| 237 | \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class, |
| 238 | function ($app) { |
| 239 | return new \Apie\Common\ContextBuilders\AddLockManagerContextBuilder( |
| 240 | $app->make(\Symfony\Component\Lock\LockFactory::class) |
| 241 | ); |
| 242 | } |
| 243 | ); |
| 244 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 245 | $this->app, |
| 246 | \Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class, |
| 247 | array( |
| 248 | 0 => 'apie.core.context_builder', |
| 249 | ) |
| 250 | ); |
| 251 | $this->app->tag([\Apie\Common\ContextBuilders\AddLockManagerContextBuilder::class], 'apie.core.context_builder'); |
| 252 | $this->app->singleton( |
| 253 | \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class, |
| 254 | function ($app) { |
| 255 | return new \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer( |
| 256 | $app->make(\Apie\Common\Interfaces\BoundedContextSelection::class), |
| 257 | $app->make(\Apie\Core\Datalayers\Search\LazyLoadedListFilterer::class) |
| 258 | ); |
| 259 | } |
| 260 | ); |
| 261 | \Apie\ServiceProviderGenerator\TagMap::register( |
| 262 | $this->app, |
| 263 | \Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class, |
| 264 | array( |
| 265 | 0 => 'apie.datalayer', |
| 266 | ) |
| 267 | ); |
| 268 | $this->app->tag([\Apie\Common\Wrappers\RequestAwareInMemoryDatalayer::class], 'apie.datalayer'); |
| 269 | $this->app->bind('apie', \Apie\Common\ApieFacade::class); |
| 270 | |
| 271 | |
| 272 | } |
| 273 | } |