ContextProhibitedServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 15 2
A register() 0 5 1
1
<?php
2
3
namespace Swatty007\LaravelContextProhibitedRule;
4
5
use Illuminate\Support\Facades\Validator;
6
use Illuminate\Support\ServiceProvider;
7
use Swatty007\LaravelContextProhibitedRule\Rules\ContextProhibited;
8
9
class ContextProhibitedServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14 14
    public function boot()
15
    {
16 14
        Validator::extend('context_prohibited', ContextProhibited::class);
17
18
        /*
19
         * Optional methods to load your package assets
20
         */
21 14
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'context-prohibited-rule');
22
23 14
        if ($this->app->runningInConsole()) {
24 14
            $this->publishes([
25 14
                __DIR__.'/../config/config.php' => config_path('context-prohibited-rule.php'),
26 14
            ], 'config');
27
        }
28 14
    }
29
30
    /**
31
     * Register the application services.
32
     */
33 14
    public function register()
34
    {
35
        // Automatically apply the package configuration
36 14
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'context-prohibited-rule');
37 14
    }
38
}
39