Completed
Push — master ( 2adaf5...166020 )
by George
05:35 queued 03:32
created

VibroServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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