CountryFlagsServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 12 1
1
<?php
2
3
namespace Stidges\LaravelCountryFlags;
4
5
use Stidges\CountryFlags\CountryFlag;
6
use Illuminate\Support\ServiceProvider;
7
8
class CountryFlagsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Perform post-registration booting of services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->publishes([
18
            __DIR__.'/../config/country-flags.php' => config_path('country-flags.php'),
19
        ], 'config');
20
21
        $this->app->bind(CountryFlag::class, function () {
22
            return new CountryFlag(config('country-flags.aliases'));
23
        });
24
25
        $this->app->singleton('country-flag', CountryFlag::class);
26
    }
27
28
    /**
29
     * Register bindings in the container.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->mergeConfigFrom(__DIR__.'/../config/country-flags.php', 'country-flags');
36
    }
37
}
38