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.
Passed
Push — master ( 18e39d...348781 )
by Toby
36:48 queued 23:00
created

AddRoleHoldersAsNewItems   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 76.47%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 15
c 1
b 0
f 0
dl 0
loc 29
ccs 13
cts 17
cp 0.7647
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 16 3
A formatItem() 0 3 1
A handles() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Export\Formatter\Role;
4
5
use BristolSU\ControlDB\Export\FormattedItem;
6
use BristolSU\ControlDB\Export\Formatter\Formatter;
7
8
class AddRoleHoldersAsNewItems extends Formatter
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AddRoleHoldersAsNewItems
Loading history...
9
{
10
11 1
    public function format($items)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function format()
Loading history...
12
    {
13 1
        $newItems = [];
14 1
        foreach($items as $item) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
15 1
            foreach($item->original()->users() as $user) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
16 1
                $newItem = clone $item;
17 1
                $dataUser = $user->data();
18 1
                $newItem->addRow('User ID', $user->id());
19 1
                $newItem->addRow('User First Name', $dataUser->firstName());
20 1
                $newItem->addRow('User Last Name', $dataUser->lastName());
21 1
                $newItem->addRow('User Preferred Name', $dataUser->preferredName());
22 1
                $newItem->addRow('User Email', $dataUser->email());
23 1
                $newItems[] = $newItem;
24
            }
25
        }
26 1
        return $newItems;
27
    }
28
29
    public function formatItem(FormattedItem $formattedItem): FormattedItem
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function formatItem()
Loading history...
30
    {
31
        return $formattedItem;
32
    }
33
34
    public function handles(): string
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function handles()
Loading history...
35
    {
36
        return static::ROLES;
37
    }
38
}