GeoServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Leitom\Geo;
4
5
use Leitom\Geo\Console\ImportCommand;
6
use Leitom\Geo\Console\RemoveCommand;
7
use Illuminate\Support\ServiceProvider;
8
9
class GeoServiceProvider extends ServiceProvider
10
{
11
    public function boot()
12
    {
13
        if ($this->app->runningInConsole()) {
14
            $this->publishes([
15
                __DIR__.'/../config/config.php' => config_path('geo.php'),
16
            ], 'config');
17
18
            $this->commands([ImportCommand::class, RemoveCommand::class]);
19
        }
20
    }
21
22
    public function register()
23
    {
24
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'geo');
25
26
        $this->app->singleton('geo', function ($app) {
27
            return new Geo($app);
28
        });
29
    }
30
}
31