Passed
Pull Request — master (#10)
by George
02:33
created

ServiceProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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
    protected $configPath;
11
12
    public function __construct(\Illuminate\Contracts\Foundation\Application $app)
13
    {
14
        $this->configPath = realpath(__DIR__ . './../../config/scaffold.php');
15
        parent::__construct($app);
16
    }
17
18
    public function boot()
19
    {
20
        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

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