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 ( 27ed08...0d3306 )
by Toby
52:35 queued 42:01
created

Role::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Cache;
4
5
use BristolSU\ControlDB\Contracts\Models\Role as RoleModel;
6
use BristolSU\ControlDB\Contracts\Repositories\Role as RoleRepositoryContract;
7
use Illuminate\Contracts\Cache\Repository;
8
use Illuminate\Support\Collection;
9
10
class Role implements RoleRepositoryContract
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Role
Loading history...
11
{
12
13
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
14
     * @var RoleRepositoryContract
15
     */
16
    private $roleRepository;
0 ignored issues
show
Coding Style introduced by
Private member variable "roleRepository" must be prefixed with an underscore
Loading history...
17
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
18
     * @var Repository
19
     */
20
    private $cache;
0 ignored issues
show
Coding Style introduced by
Private member variable "cache" must be prefixed with an underscore
Loading history...
21
22 33
    public function __construct(RoleRepositoryContract $roleRepository, Repository $cache)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
23
    {
24 33
        $this->roleRepository = $roleRepository;
25 33
        $this->cache = $cache;
26 33
    }
27
28
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $id should have a doc-comment as per coding-style.
Loading history...
29
     * @inheritDoc
30
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
31 22
    public function getById(int $id): RoleModel
32
    {
33
        return $this->cache->remember(static::class . '@getById:' . $id, 5000, function() use ($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
34 22
            return $this->roleRepository->getById($id);
35 22
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
36
    }
37
38
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
39
     * @inheritDoc
40
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
41 1
    public function all(): Collection
42
    {
43 1
        return $this->roleRepository->all();
44
    }
45
46
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $dataProviderId should have a doc-comment as per coding-style.
Loading history...
47
     * @inheritDoc
48
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
49 2
    public function getByDataProviderId(int $dataProviderId): RoleModel
50
    {
51
        return $this->cache->remember(static::class . '@getByDataProviderId:' . $dataProviderId, 5000, function() use ($dataProviderId) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
52 2
            return $this->roleRepository->getByDataProviderId($dataProviderId);
53 2
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
54
    }
55
56
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $positionId should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $groupId should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $dataProviderId should have a doc-comment as per coding-style.
Loading history...
57
     * @inheritDoc
58
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
59 2
    public function create(int $positionId, int $groupId, int $dataProviderId): RoleModel
60
    {
61 2
        return $this->roleRepository->create($positionId, $groupId, $dataProviderId);
62
    }
63
64
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $id should have a doc-comment as per coding-style.
Loading history...
65
     * @inheritDoc
66
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
67 1
    public function delete(int $id): void
68
    {
69 1
        $this->roleRepository->delete($id);
70 1
    }
71
72
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $group should have a doc-comment as per coding-style.
Loading history...
73
     * @inheritDoc
74
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
75 3
    public function allThroughGroup(\BristolSU\ControlDB\Contracts\Models\Group $group): Collection
76
    {
77 3
        return $this->roleRepository->allThroughGroup($group);
78
    }
79
80
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $position should have a doc-comment as per coding-style.
Loading history...
81
     * @inheritDoc
82
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
83 3
    public function allThroughPosition(\BristolSU\ControlDB\Contracts\Models\Position $position): Collection
84
    {
85 3
        return $this->roleRepository->allThroughPosition($position);
86
    }
87
}