NovaPoshtaServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 7 1
A register() 0 9 1
1
<?php
2
3
namespace Daaner\NovaPoshta;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class NovaPoshtaServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->publishes([
17
            __DIR__.'/../config/novaposhta.php' => config_path('novaposhta.php'),
18
        ], 'config');
19
20
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang/', 'novaposhta');
21
    }
22
23
    /**
24
     * Register services.
25
     *
26
     * @return void
27
     */
28
    public function register()
29
    {
30
        $this->mergeConfigFrom(__DIR__.'/../config/novaposhta.php', 'novaposhta');
31
32
        $this->app->singleton('novaposhta', function () {
33
            return $this->app->make(NovaPoshta::class);
34
        });
35
36
        $this->app->alias('novaposhta', 'NovaPoshta');
37
    }
38
}
39