HelloWorldServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 32
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 2
A register() 0 8 1
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