ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 17
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A boot() 0 15 2
A register() 0 5 1
1
<?php
2
3
namespace Ghaskell\Scaffold\Providers;
4
5
use Ghaskell\Scaffold\Console\Commands\ScaffoldGenerate;
6
use Ghaskell\Scaffold\Facades\Code;
7
8
class ServiceProvider extends \Illuminate\Support\ServiceProvider
9
{
10
    const CONFIG_PATH = __DIR__ . './../../config/scaffold.php';
11
12
    protected $configPath;
13
14
    public function __construct(\Illuminate\Contracts\Foundation\Application $app)
15
    {
16
//        $this->configPath =
17
        parent::__construct($app);
18
19
    }
20
21
    public function boot()
22
    {
23
        Code::addExtension('stub',  'vibro');
0 ignored issues
show
Bug introduced by
The method addExtension() does not exist on Ghaskell\Scaffold\Facades\Code. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

23
        Code::/** @scrutinizer ignore-call */ 
24
              addExtension('stub',  'vibro');
Loading history...
24
        $this->publishes([
25
            self::CONFIG_PATH => config_path('scaffold.php'),
26
        ], 'config');
27
28
        if ($this->app->runningInConsole()) {
29
            $this->commands([
30
                ScaffoldGenerate::class,
31
            ]);
32
        }
33
        $this->publishes([
34
            realpath(__DIR__ . '/../stubs') => app_path('Scaffold/stubs')
35
        ], 'Scaffold Stubs');
36
    }
37
    public function register()
38
    {
39
        $this->mergeConfigFrom(
40
            self::CONFIG_PATH,
41
            'scaffold'
42
        );
43
    }
44
}
45