Completed
Push — master ( ef73d7...7d6982 )
by George
05:23 queued 03:14
created

ServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 31
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
    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