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.

Issues (4568)

src/Observers/NotifyObservers/RoleNotifier.php (25 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Observers\NotifyObservers;
4
5
use BristolSU\ControlDB\Contracts\Models\Role as RoleModel;
6
use BristolSU\ControlDB\Contracts\Repositories\Role;
7
use BristolSU\ControlDB\Contracts\Repositories\Role as RoleRepository;
8
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\Notifier;
9
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\ObserverStore;
10
use Illuminate\Support\Collection;
11
12
class RoleNotifier extends Notifier implements RoleRepository
0 ignored issues
show
Missing doc comment for class RoleNotifier
Loading history...
13
{
14
15
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
16
     * @var RoleRepository
17
     */
18
    private $roleRepository;
0 ignored issues
show
Private member variable "roleRepository" must be prefixed with an underscore
Loading history...
19
20 48
    public function __construct(RoleRepository $roleRepository, ObserverStore $observerStore)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
21
    {
22 48
        parent::__construct($observerStore, RoleRepository::class);
23 48
        $this->roleRepository = $roleRepository;
24 48
    }
25
26
    /**
27
     * Get a role by ID
28
     *
29
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
30
     * @return RoleModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
31
     */
32 25
    public function getById(int $id): RoleModel
33
    {
34 25
        return $this->roleRepository->getById($id);
35
    }
36
37
    /**
38
     * Get all roles
39
     *
40
     * @return Collection|\BristolSU\ControlDB\Contracts\Models\Role[]
41
     */
42 1
    public function all(): Collection
43
    {
44 1
        return $this->roleRepository->all();
45
    }
46
47
    /**
48
     * Get a role by data provider ID
49
     *
50
     * @param int $dataProviderId
0 ignored issues
show
Missing parameter comment
Loading history...
51
     * @return RoleModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
52
     */
53 2
    public function getByDataProviderId(int $dataProviderId): RoleModel
54
    {
55 2
        return $this->roleRepository->getByDataProviderId($dataProviderId);
56
    }
57
58
    /**
59
     * Create a new role
60
     *
61
     * @param int $positionId
0 ignored issues
show
Missing parameter comment
Loading history...
62
     * @param int $groupId
0 ignored issues
show
Missing parameter comment
Loading history...
63
     * @param int $dataProviderId
0 ignored issues
show
Missing parameter comment
Loading history...
64
     * @return RoleModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
65
     */
66 2
    public function create(int $positionId, int $groupId, int $dataProviderId): RoleModel
67
    {
68 2
        $roleModel = $this->roleRepository->create($positionId, $groupId, $dataProviderId);
69 2
        $this->notify('create', $roleModel);
70 2
        return $roleModel;
71
    }
72
73
    /**
74
     * Delete a role
75
     *
76
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
77
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
78 1
    public function delete(int $id): void
79
    {
80 1
        $roleModel = $this->getById($id);
81 1
        $this->roleRepository->delete($id);
82 1
        $this->notify('delete', $roleModel);
83 1
    }
84
85
    /**
86
     * Update the role model
87
     *
88
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
89
     * @param int $positionId
0 ignored issues
show
Missing parameter comment
Loading history...
90
     * @param int $groupId
0 ignored issues
show
Missing parameter comment
Loading history...
91
     * @param int $dataProviderId New data provider ID
92
     * @return RoleModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
93
     */
94 5
    public function update(int $id, int $positionId, int $groupId, int $dataProviderId): RoleModel
95
    {
96 5
        $oldRoleModel = $this->getById($id);
97 5
        $newRoleModel = $this->roleRepository->update($id, $positionId, $groupId, $dataProviderId);
98 5
        $this->notify('update', $oldRoleModel, $newRoleModel);
99 5
        return $newRoleModel;
100
    }
101
102
    /**
103
     * Get all roles that belong to the given group
104
     *
105
     * @param \BristolSU\ControlDB\Contracts\Models\Group $group
0 ignored issues
show
Missing parameter comment
Loading history...
106
     * @return Collection|RoleModel[]
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
107
     */
108 4
    public function allThroughGroup(\BristolSU\ControlDB\Contracts\Models\Group $group): Collection
109
    {
110 4
        return $this->roleRepository->allThroughGroup($group);
111
    }
112
113
    /**
114
     * Get all roles that belong to the given position
115
     * @param \BristolSU\ControlDB\Contracts\Models\Position $position
0 ignored issues
show
There must be exactly one blank line before the tags in a doc comment
Loading history...
Missing parameter comment
Loading history...
116
     * @return Collection|RoleModel[]
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
117
     */
118 4
    public function allThroughPosition(\BristolSU\ControlDB\Contracts\Models\Position $position): Collection
119
    {
120 4
        return $this->roleRepository->allThroughPosition($position);
121
    }
122
123
    /**
124
     * Paginate through all the roles
125
     *
126
     * @param int $page The page number to return
0 ignored issues
show
Expected 4 spaces after parameter name; 1 found
Loading history...
127
     * @param int $perPage The number of results to return per page
128
     *
129
     * @return Collection|RoleModel[]
130
     */
131 2
    public function paginate(int $page, int $perPage): Collection
132
    {
133 2
        return $this->roleRepository->paginate($page, $perPage);
134
    }
135
136
    /**
137
     * Get the number of roles
138
     *
139
     * @return int
140
     */
141 2
    public function count(): int
142
    {
143 2
        return $this->roleRepository->count();
144
    }
145
}