ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 7
c 2
b 1
f 0
nc 2
nop 0
dl 0
loc 13
rs 10
1
<?php
2
3
namespace Cherrypulp\LaravelPackageGenerator;
4
5
use Cherrypulp\LaravelPackageGenerator\Commands\PackageNew;
6
use Cherrypulp\LaravelPackageGenerator\Commands\PackageRemove;
7
8
class ServiceProvider extends \Illuminate\Support\ServiceProvider
9
{
10
    const CONFIG_PATH = __DIR__.'/../config/laravel-package-generator.php';
11
12
    public function boot()
13
    {
14
        $this->publishes([
15
            self::CONFIG_PATH => config_path('laravel-package-generator.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
            self::CONFIG_PATH => /** @scrutinizer ignore-call */ config_path('laravel-package-generator.php'),
Loading history...
16
        ], 'config');
17
18
        if ($this->app->runningInConsole()) {
19
20
21
22
            $this->commands([
23
                PackageNew::class,
24
                PackageRemove::class,
25
            ]);
26
        }
27
    }
28
29
    public function register()
30
    {
31
        $this->mergeConfigFrom(
32
            self::CONFIG_PATH,
33
            'laravel-package-generator'
34
        );
35
    }
36
}
37