ServerPermissionHelper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 23
c 1
b 0
f 0
dl 0
loc 36
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAllPermissions() 0 3 1
1
<?php
2
3
namespace Gameap\Helpers;
4
5
use Gameap\Models\Server;
6
7
class ServerPermissionHelper
8
{
9
    const CONTROL_ABILITY = 'server-control';
10
    const START_ABILITY = 'server-start';
11
    const STOP_ABILITY = 'server-stop';
12
    const RESTART_ABILITY = 'server-restart';
13
    const UPDATE_ABILITY = 'server-update';
14
    const CONSOLE_VIEW_ABILITY = 'server-console-view';
15
    const CONSOLE_SEND_ABILITY = 'server-console-send';
16
17
    /**
18
     * @var array All game server permission
19
     */
20
    private static $allServersPermissions = [
21
        'game-server-common',
22
        'game-server-start',
23
        'game-server-stop',
24
        'game-server-restart',
25
        'game-server-pause',
26
        'game-server-update',
27
        'game-server-files',
28
        'game-server-tasks',
29
        'game-server-settings',
30
31
        // Console
32
        'game-server-console-view',
33
        'game-server-console-send',
34 6
35
        // RCON
36 6
        'game-server-rcon-console',
37
        'game-server-rcon-players',
38
    ];
39
40
    public static function getAllPermissions()
41
    {
42
        return self::$allServersPermissions;
43
    }
44
}
45