Passed
Push — master ( e889f2...0c6ae7 )
by Yaroslav
20:05 queued 10s
created

ServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

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