ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
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