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.

UserAssigned::getFieldMetaData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 42
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 31
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 42
ccs 0
cts 2
cp 0
crap 2
rs 9.424
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\ControlDB\Contracts\Models\User;
7
use BristolSU\Support\Action\Contracts\TriggerableEvent;
8
9
class UserAssigned implements TriggerableEvent
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class UserAssigned
Loading history...
10
{
11
12
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
13
     * @var User
14
     */
15
    private $user;
0 ignored issues
show
Coding Style introduced by
Private member variable "user" must be prefixed with an underscore
Loading history...
16
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
17
     * @var Role
18
     */
19
    private $role;
0 ignored issues
show
Coding Style introduced by
Private member variable "role" must be prefixed with an underscore
Loading history...
20
21 2
    public function __construct(User $user, Role $role)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
22
    {
23 2
        $this->user = $user;
24 2
        $this->role = $role;
25 2
    }
26
27
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
28
     * @inheritDoc
29
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
30
    public function getFields(): array
31
    {
32
        return [
33
            'role_id' => $this->role->id(),
34
            'position_id' => $this->role->positionId(),
35
            'position_name' => $this->role->position()->data()->name(),
36
            'role_name' => $this->role->data()->roleName(),
37
            'role_email' => $this->role->data()->email(),
38
            'user_id' => $this->user->id(),
39
            'user_first_name' => $this->user->data()->firstName(),
40
            'user_last_name' => $this->user->data()->lastName(),
41
            'user_preferred_name' => $this->user->data()->preferredName(),
42
            'user_email' => $this->user->data()->email()
43
        ];
44
    }
45
46
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
47
     * @inheritDoc
48
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
49
    public static function getFieldMetaData(): array
50
    {
51
        return [
52
            'role_id' => [
53
                'label' => 'Role ID',
54
                'helptext' => 'ID of the role that was assigned to'
55
            ],
56
            'position_id' => [
57
                'label' => 'Position ID',
58
                'helptext' => 'ID of the position that was assigned to'
59
            ],
60
            'position_name' => [
61
                'label' => 'Position Name',
62
                'helptext' => 'Name of the position that was assigned to'
63
            ],
64
            'role_name' => [
65
                'label' => 'Role Name',
66
                'helptext' => 'Custom name for the role that was assigned to'
67
            ],
68
            'role_email' => [
69
                'label' => 'Role Email',
70
                'helptext' => 'Email of the role that was assigned to'
71
            ],
72
            'user_id' => [
73
                'label' => 'User ID',
74
                'helptext' => 'ID of the user that was assigned'
75
            ],
76
            'user_first_name' => [
77
                'label' => 'User First Name',
78
                'helptext' => 'First name of the user that was assigned'
79
            ],
80
            'user_last_name' => [
81
                'label' => 'User Last Name',
82
                'helptext' => 'Last name of the user that was assigned'
83
            ],
84
            'user_preferred_name' => [
85
                'label' => 'User Preferred Name',
86
                'helptext' => 'Preferred name of the user that was assigned'
87
            ],
88
            'user_email' => [
89
                'label' => 'User Email',
90
                'helptext' => 'Email of the user that was assigned'
91
            ]
92
        ];
93
    }
94
}