HelloWorldServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Bmatovu\HelloWorld;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class HelloWorldServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14 3
    public function boot()
15
    {
16 3
        if ($this->app->runningInConsole()) {
17 3
            $this->publishes([
18 3
                __DIR__.'/../config/hello-world.php' => base_path('config/hello-world.php'),
19 3
            ], 'config');
20
21 3
            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
22
        }
23 3
    }
24
25
    /**
26
     * Register the application services.
27
     *
28
     * @return void
29
     */
30 3
    public function register()
31
    {
32 3
        $this->mergeConfigFrom(__DIR__.'/../config/hello-world.php', 'hello-world');
33
34
        $this->app->bind('hello-world', function () {
35 2
            return new HelloWorld();
36 3
        });
37 3
    }
38
}
39