BrandingServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Zoutapps\Laravel\Backpack\Branding;
4
5
use Illuminate\Support\ServiceProvider;
6
use Zoutapps\Laravel\Backpack\Branding\Commands\BrandingCommand;
7
8
class BrandingServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Perform post-registration booting of services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        if ($this->app->runningInConsole()) {
18
            $this->commands([
19
                BrandingCommand::class,
20
            ]);
21
        }
22
    }
23
24
    /**
25
     * Register any package services.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        $this->app->singleton(Branding::class, function () {
32
            return new Branding();
33
        });
34
        $this->app->alias(Branding::class, 'branding');
35
    }
36
}