DatosAbiertosServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 36
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 2
A register() 0 18 1
1
<?php
2
3
namespace Andreshg112\DatosAbiertos;
4
5
use Illuminate\Support\ServiceProvider;
6
use Andreshg112\DatosAbiertos\Datasets\Colegios;
7
use Andreshg112\DatosAbiertos\Datasets\Divipola;
8
use Andreshg112\DatosAbiertos\Datasets\OrganismosTransito;
9
10
class DatosAbiertosServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Bootstrap the application services.
14
     */
15 6
    public function boot()
16
    {
17 6
        if ($this->app->runningInConsole()) {
18 6
            $this->publishes([
19 6
                __DIR__ . '/../config/datos-abiertos.php' => config_path('datos-abiertos.php'),
20 6
            ], 'datos-abiertos');
21
        }
22 6
    }
23
24
    /**
25
     * Register the application services.
26
     */
27 6
    public function register()
28
    {
29
        // Automatically apply the package configuration
30 6
        $this->mergeConfigFrom(__DIR__ . '/../config/datos-abiertos.php', 'datos-abiertos');
31
32
        // Register the main class to use with the facade
33
        $this->app->singleton('colegios', function () {
34 2
            return new Colegios;
35 6
        });
36
37
        $this->app->singleton('divipola', function () {
38 2
            return new Divipola;
39 6
        });
40
41
        $this->app->singleton('organismo-transito', function () {
42 2
            return new OrganismosTransito;
43 6
        });
44 6
    }
45
}
46