Passed
Push — master ( 39e5a8...610dd1 )
by Yaroslav
03:43
created

ServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

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