ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 29
ccs 13
cts 13
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 18 2
A register() 0 3 1
1
<?php
2
3
namespace LaraGeoData;
4
5
use LaraGeoData\Console\Commands\DownloadFilesCommand;
6
use LaraGeoData\Console\Commands\DownloadTruncateCommand;
7
use LaraGeoData\Console\Commands\LoadDataToDBCommand;
8
use LaraGeoData\Console\Commands\MakeMigrationCommand;
9
10
class ServiceProvider extends \Illuminate\Support\ServiceProvider
11
{
12 28
    public function boot()
13
    {
14 28
        if ($this->app->runningInConsole()) {
15 28
            $this->publishes([
16 28
                __DIR__ . '/../config/geonames.php' => config_path('geonames.php'),
17 28
            ], 'config');
18
19
20 28
            $this->commands([
21 28
                DownloadFilesCommand::class,
22
                DownloadTruncateCommand::class,
23
                MakeMigrationCommand::class,
24
                LoadDataToDBCommand::class,
25
            ]);
26
        }
27
28 28
        $this->app->bind('geodata-importer', function ($app) {
29 16
            return new GeoDataImporter($app);
30 28
        });
31 28
    }
32
33
    /**
34
     * @inheritDoc
35
     */
36 28
    public function register()
37
    {
38 28
        $this->mergeConfigFrom(__DIR__ . '/../config/geonames.php', 'geonames');
39 28
    }
40
}
41