ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of ibrand/address.
5
 *
6
 * (c) iBrand <https://www.ibrand.cc>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace iBrand\Component\Address;
13
14
/**
15
 * Class ServiceProvider.
16
 */
17
class ServiceProvider extends \Illuminate\Support\ServiceProvider
18
{
19
    /**
20
     *  Boot the service provider.
21
     */
22 3
    public function boot()
23
    {
24 3
        if ($this->app->runningInConsole()) {
25 3
            $this->registerMigrations();
26
        }
27 3
    }
28
29
    /**
30
     * Register the service provider.
31
     */
32 3
    public function register()
33
    {
34 3
        $this->app->bind(RepositoryContract::class, Repository::class);
35 3
    }
36
37
    /**
38
     * Register migration files.
39
     */
40 3
    protected function registerMigrations()
41
    {
42 3
        return $this->loadMigrationsFrom(__DIR__.'/../migrations');
43
    }
44
}
45