VibroServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: georg
5
 * Date: 5/28/2018
6
 * Time: 1:09 PM
7
 */
8
9
namespace Ghaskell\Scaffold\Providers;
10
11
use Ghaskell\Scaffold\VibroCompiler;
12
use Illuminate\Support\Facades\App;
13
use Illuminate\View\ViewServiceProvider;
14
15
class VibroServiceProvider extends ViewServiceProvider
16
{
17
    const CONFIG_PATH = __DIR__ . './../../config/scaffold.php';
18
19
    public function boot()
20
    {
21
        $this->publishes([
22
            self::CONFIG_PATH => config_path('scaffold.php'),
23
        ], 'config');
24
    }
25
26
    public function register()
27
    {
28
        $this->app->singleton('vibro.compiler', function () {
29
            return new VibroCompiler(
30
                $this->app['files'], $this->app['config']['view.compiled']
31
            );
32
        });
33
34
        App::bind('vibro', function()
35
        {
36
            return new VibroCompiler(
37
                $this->app['files'], $this->app['config']['view.compiled']
38
            );
39
        });
40
    }
41
42
//    public function registerVibroEngine($resolver)
43
//    {
44
//        $this->app->singleton('blade.compiler', function () {
45
//            return new Vibroblade(
46
//                $this->app['files'], $this->app['config']['view.compiled']
47
//            );
48
//        });
49
//
50
//        $resolver->register('blade', function () {
51
//            return new CompilerEngine($this->app['blade.compiler']);
52
//        });
53
//    }
54
}