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.

CrudServiceProvider::boot()   B
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 40
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 23
nc 4
nop 0
dl 0
loc 40
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace Akibatech\Crud;
4
5
use Akibatech\Crud\Console\CrudControllerMakeCommand;
6
use Illuminate\Support\Facades\Blade;
7
use Illuminate\Support\ServiceProvider;
8
9
/**
10
 * Class CrudServiceProvider
11
 *
12
 * @package Akibatech\Crud
13
 */
14
class CrudServiceProvider extends ServiceProvider
15
{
16
    /**
17
     * @param   void
18
     * @return  void
19
     */
20
    public function boot()
21
    {
22
        if ($this->app->runningInConsole())
23
        {
24
            $this->commands([
25
                CrudControllerMakeCommand::class
26
            ]);
27
28
            $this->publishes([
29
                __DIR__ . '/../resources/lang/' => resource_path('lang/vendor/crud'),
30
            ], 'crud');
31
32
            $this->publishes([
33
                __DIR__ . '/../resources/views/' => resource_path('views/vendor/crud'),
34
            ], 'crud');
35
36
            $this->publishes([
37
                __DIR__ . '/../resources/assets/' => public_path('vendor/crud'),
38
            ], 'crud');
39
        }
40
41
        if ($this->app->runningUnitTests())
42
        {
43
            $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'crud');
44
            $this->loadTranslationsFrom(__DIR__ . '/../resources/lang/', 'crud');
45
        }
46
        else
47
        {
48
            $this->loadViewsFrom(resource_path('views/vendor/crud'), 'crud');
49
            $this->loadTranslationsFrom(resource_path('lang/vendor/crud'), 'crud');
50
        }
51
52
        Blade::directive('crudtable', function($expression) {
53
            return "<?php echo crud_table($expression); ?>";
54
        });
55
56
        Blade::directive('crudentry', function($expression) {
57
            return "<?php echo crud_entry($expression); ?>";
58
        });
59
    }
60
61
    /**
62
     * @param   void
63
     * @return  void
64
     */
65
    public function register()
66
    {
67
        $this->app->bind('Akibatech\Crud\Crud', Crud::class);
68
        $this->app->alias('Akibatech\Crud\Crud', 'crud');
69
70
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
71
        $loader->alias('Crud', 'Akibatech\Crud\CrudFacade');
72
    }
73
}
74