| Conditions | 3 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3.0026 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 3 | public function register() |
|
| 17 | { |
||
| 18 | 3 | $this->mergeConfigFrom($this->getConfigPath(), 'loadsman'); |
|
| 19 | |||
| 20 | 3 | if (! $this->app['config']['loadsman.enabled']) { |
|
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | 3 | $this->app->register(MacroServiceProvider::class); |
|
| 25 | 3 | $this->app->register(FrameworkServiceProvider::class); |
|
| 26 | 3 | $this->app->register(RuleServiceProvider::class); |
|
| 27 | |||
| 28 | 3 | $this->app->bind(RuleRepository::class, function (Container $app) { |
|
| 29 | |||
| 30 | 3 | $routers = []; |
|
| 31 | 3 | foreach ($app['config']['loadsman.routers'] as $routerName){ |
|
| 32 | 3 | $routers[] = $app->make($routerName); |
|
| 33 | 2 | } |
|
| 34 | |||
| 35 | 3 | return new RuleRepository($routers); |
|
| 36 | 3 | }); |
|
| 37 | |||
| 38 | 3 | } |
|
| 39 | |||
| 54 |