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::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
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