Completed
Push — master ( 662b61...b40adf )
by George
04:45 queued 02:21
created

ServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 10
nc 2
nop 0
1
<?php
2
3
namespace Ghaskell\Scaffold\Providers;
4
5
use Ghaskell\Scaffold\Console\Commands\ScaffoldGenerate;
6
use Ghaskell\Scaffold\Facades\Vibro;
7
use Illuminate\Support\Facades\View;
8
use Illuminate\View\Compilers\BladeCompiler;
9
10
class ServiceProvider extends \Illuminate\Support\ServiceProvider
11
{
12
    const CONFIG_PATH = __DIR__ . '/../config/scaffold.php';
13
14
    public function boot()
15
    {
16
        Code::addExtension('stub',  'vibro');
17
        $this->publishes([
18
            self::CONFIG_PATH => config_path('scaffold.php'),
19
        ], 'config');
20
21
        if ($this->app->runningInConsole()) {
22
            $this->commands([
23
                ScaffoldGenerate::class,
24
            ]);
25
        }
26
        $this->publishes([
27
            __DIR__ . '/stubs' => app_path('Scaffold/stubs')
28
        ], 'Scaffold Stubs');
29
    }
30
    public function register()
31
    {
32
        $this->mergeConfigFrom(
33
            self::CONFIG_PATH,
34
            'scaffold'
35
        );
36
    }
37
}
38