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.

RoleCreated   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 27.27%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 25
c 1
b 0
f 0
dl 0
loc 52
ccs 3
cts 11
cp 0.2727
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFields() 0 8 1
A getFieldMetaData() 0 22 1
A __construct() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\Module\AssignRoles\Events;
4
5
use BristolSU\ControlDB\Contracts\Models\Role;
6
use BristolSU\Support\Action\Contracts\TriggerableEvent;
7
8
class RoleCreated implements TriggerableEvent
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class RoleCreated
Loading history...
9
{
10
11
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
12
     * @var Role
13
     */
14
    private $role;
0 ignored issues
show
Coding Style introduced by
Private member variable "role" must be prefixed with an underscore
Loading history...
15
16 6
    public function __construct(Role $role)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
17
    {
18 6
        $this->role = $role;
19 6
    }
20
21
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
22
     * @inheritDoc
23
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
24
    public function getFields(): array
25
    {
26
        return [
27
            'role_id' => $this->role->id(),
28
            'position_id' => $this->role->positionId(),
29
            'position_name' => $this->role->position()->data()->name(),
30
            'role_name' => $this->role->data()->roleName(),
31
            'role_email' => $this->role->data()->email(),
32
        ];
33
    }
34
35
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
36
     * @inheritDoc
37
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
38
    public static function getFieldMetaData(): array
39
    {
40
        return [
41
            'role_id' => [
42
                'label' => 'Role ID',
43
                'helptext' => 'ID of the role that was assigned to'
44
            ],
45
            'position_id' => [
46
                'label' => 'Position ID',
47
                'helptext' => 'ID of the position that was assigned to'
48
            ],
49
            'position_name' => [
50
                'label' => 'Position Name',
51
                'helptext' => 'Name of the position that was assigned to'
52
            ],
53
            'role_name' => [
54
                'label' => 'Role Name',
55
                'helptext' => 'Custom name for the role that was assigned to'
56
            ],
57
            'role_email' => [
58
                'label' => 'Role Email',
59
                'helptext' => 'Email of the role that was assigned to'
60
            ]
61
        ];
62
    }
63
}