TagHelperServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 13 1
1
<?php
2
3
namespace BeyondCode\TagHelper;
4
5
use Illuminate\Support\ServiceProvider;
6
use BeyondCode\TagHelper\Helpers\AuthHelper;
7
use BeyondCode\TagHelper\Helpers\CsrfHelper;
8
use BeyondCode\TagHelper\Helpers\LinkHelper;
9
use BeyondCode\TagHelper\Helpers\GuestHelper;
10
use BeyondCode\TagHelper\Helpers\ConditionHelper;
11
use BeyondCode\TagHelper\Helpers\FormMethodHelper;
12
13
class TagHelperServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Register the application services.
17
     */
18
    public function register()
19
    {
20
        $this->app->singleton(TagHelper::class);
21
22
        $this->app->alias(TagHelper::class, 'tag-helper');
23
    }
24
25
    /**
26
     * Bootstrap the application services.
27
     */
28
    public function boot()
29
    {
30
        $this->app['blade.compiler']->extend(function ($view) {
31
            return $this->app[TagHelperCompiler::class]->compile($view);
32
        });
33
34
        $this->app['tag-helper']->helper(LinkHelper::class);
35
        $this->app['tag-helper']->helper(FormMethodHelper::class);
36
        $this->app['tag-helper']->helper(CsrfHelper::class);
37
        $this->app['tag-helper']->helper(ConditionHelper::class);
38
        $this->app['tag-helper']->helper(AuthHelper::class);
39
        $this->app['tag-helper']->helper(GuestHelper::class);
40
    }
41
}
42