CountryFlagsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 9
cp 0
crap 2
rs 9.8666
c 0
b 0
f 0
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