AuthServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 22
ccs 16
cts 16
cp 1
rs 9.7666
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Gameap\Providers;
4
5
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
6
use Illuminate\Support\Facades\Gate;
7
8
class AuthServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * The policy mappings for the application.
12
     *
13
     * @var array
14
     */
15
    protected $policies = [
16
        \Gameap\Models\Server::class => \Gameap\Policies\ServerPolicy::class,
17
    ];
18
19
    /**
20
     * Register any authentication / authorization services.
21
     *
22
     * @return void
23
     */
24 108
    public function boot(): void
25
    {
26 108
        $this->registerPolicies();
27
28 108
        Gate::define('server-control', 'Gameap\Policies\ServerPolicy@control');
29 108
        Gate::define('server-start', 'Gameap\Policies\ServerPolicy@start');
30 108
        Gate::define('server-stop', 'Gameap\Policies\ServerPolicy@stop');
31 108
        Gate::define('server-restart', 'Gameap\Policies\ServerPolicy@restart');
32 108
        Gate::define('server-pause', 'Gameap\Policies\ServerPolicy@pause');
33 108
        Gate::define('server-update', 'Gameap\Policies\ServerPolicy@update');
34 108
        Gate::define('server-files', 'Gameap\Policies\ServerPolicy@files');
35 108
        Gate::define('server-tasks', 'Gameap\Policies\ServerPolicy@tasks');
36 108
        Gate::define('server-settings', 'Gameap\Policies\ServerPolicy@settings');
37
38
        // Console
39 108
        Gate::define('server-console-view', 'Gameap\Policies\ServerPolicy@consoleView');
40 108
        Gate::define('server-console-send', 'Gameap\Policies\ServerPolicy@consoleSend');
41
42
        // RCON
43 108
        Gate::define('server-rcon', 'Gameap\Policies\ServerPolicy@rcon');
44 108
        Gate::define('server-rcon-console', 'Gameap\Policies\ServerPolicy@rconConsole');
45 108
        Gate::define('server-rcon-players', 'Gameap\Policies\ServerPolicy@rconPlayers');
46 108
    }
47
}
48