ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 4 1
A registerBladeDirectives() 0 6 1
1
<?php namespace JTGrimes\FeatureFlag;
2
3
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
4
5
class ServiceProvider extends BaseServiceProvider
6
{
7
    public function boot()
8
    {
9
        $this->publishes([__DIR__.'/../config/features.php' => config_path('features.php')]);
10
11
        $this->mergeConfigFrom(__DIR__.'/../config/features.php', 'features');
12
    }
13
14
    public function register()
15
    {
16
        $this->registerBladeDirectives();
17
    }
18
19
    private function registerBladeDirectives()
20
    {
21
        \Blade::directive('ifFeature', function ($featureName) {
22
            return "<?php if(feature({$featureName})) : ?>";
23
        });
24
    }
25
}
26