LaravelMapboxServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Bakerkretzmar\LaravelMapbox;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LaravelMapboxServiceProvider extends ServiceProvider
8
{
9 36
    public function boot()
10
    {
11 36
        $this->publishes([
12 36
            __DIR__.'/../config/laravel-mapbox.php' => config_path('laravel-mapbox.php'),
13
        ]);
14 36
    }
15
16 36
    public function register()
17
    {
18 36
        $this->mergeConfigFrom(__DIR__.'/../config/laravel-mapbox.php', 'laravel-mapbox');
19
20
        $this->app->singleton(Mapbox::class, function () {
21 36
            return new Mapbox(config('laravel-mapbox'));
22 36
        });
23
24 36
        $this->app->alias(Mapbox::class, 'mapbox');
25 36
    }
26
}
27