Test Failed
Push — master ( 8c8503...dfefa4 )
by Yaroslav
03:40
created

ServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 28
ccs 0
cts 13
cp 0
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
    public function boot()
12
    {
13
        if ($this->app->runningInConsole()) {
14
            $this->publishes([
15
                __DIR__ . '/../config/geonames.php' => config_path('geonames.php'),
16
            ], 'config');
17
18
19
            $this->commands([
20
                DownloadFilesCommand::class,
21
                DownloadTruncateCommand::class,
22
                MakeMigrationCommand::class,
23
            ]);
24
        }
25
26
        $this->app->bind('geodata-importer', function ($app) {
27
            return new GeoDataImporter($app);
28
        });
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function register()
35
    {
36
        $this->mergeConfigFrom(__DIR__ . '/../config/geonames.php', 'geonames');
37
    }
38
}
39