GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LockoutServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 41
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 2
A register() 0 10 1
A registerBladeExtensions() 0 10 1
1
<?php
2
3
namespace Rappasoft\Lockout;
4
5
use Illuminate\Contracts\Http\Kernel;
6
use Illuminate\Support\Facades\Blade;
7
use Illuminate\Support\ServiceProvider;
8
use Rappasoft\Lockout\Http\Middleware\CheckForReadOnlyMode;
9
10
/**
11
 * Class LockoutServiceProvider.
12
 */
13
class LockoutServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Bootstrap the application services.
17
     */
18 14
    public function boot()
19
    {
20 14
        if ($this->app->runningInConsole()) {
21 14
            $this->publishes([
22 14
                __DIR__.'/../config/lockout.php' => config_path('lockout.php'),
23 14
            ], 'config');
24
        }
25
26 14
        $this->registerBladeExtensions();
27 14
    }
28
29
    /**
30
     * Register the application services.
31
     */
32 14
    public function register()
33
    {
34
        // Register the config file
35 14
        $this->mergeConfigFrom(__DIR__.'/../config/lockout.php', 'lockout');
36
37
        // Publish the middleware globally
38 14
        $this->app
39 14
            ->make(Kernel::class)
40 14
            ->pushMiddleware(CheckForReadOnlyMode::class);
41 14
    }
42
43 14
    protected function registerBladeExtensions()
44
    {
45
        /*
46
         * The block of code inside this directive indicates
47
         * the project is currently running in read only mode.
48
         */
49 14
        Blade::if('readonly', function () {
50 1
            return config('lockout.enabled');
51 14
        });
52 14
    }
53
}
54