ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 12
c 3
b 1
f 0
dl 0
loc 26
rs 10
wmc 3

2 Methods

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