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/GroupNotifier.php (15 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\Group as GroupModel;
6
use BristolSU\ControlDB\Contracts\Repositories\Group as GroupRepository;
7
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\Notifier;
8
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\ObserverStore;
9
use Illuminate\Support\Collection;
10
11
class GroupNotifier extends Notifier implements GroupRepository
0 ignored issues
show
Missing doc comment for class GroupNotifier
Loading history...
12
{
13
14
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
15
     * @var GroupRepository
16
     */
17
    private $groupRepository;
0 ignored issues
show
Private member variable "groupRepository" must be prefixed with an underscore
Loading history...
18
19 36
    public function __construct(GroupRepository $groupRepository, ObserverStore $observerStore)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
20
    {
21 36
        parent::__construct($observerStore, GroupRepository::class);
22 36
        $this->groupRepository = $groupRepository;
23 36
    }
24
25
    /**
26
     * Get a group by ID
27
     *
28
     * @param int $id ID of the group
29
     * @return GroupModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
30
     */
31 27
    public function getById(int $id): GroupModel
32
    {
33 27
        return $this->groupRepository->getById($id);
34
    }
35
36
    /**
37
     * Get a group by its data provider ID
38
     *
39
     * @param int $dataProviderId
0 ignored issues
show
Missing parameter comment
Loading history...
40
     * @return GroupModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
41
     */
42 2
    public function getByDataProviderId(int $dataProviderId): GroupModel
43
    {
44 2
        return $this->groupRepository->getByDataProviderId($dataProviderId);
45
    }
46
47
    /**
48
     * Get all groups
49
     *
50
     * @return Collection|GroupModel[]
51
     */
52 1
    public function all(): Collection
53
    {
54 1
        return $this->groupRepository->all();
55
    }
56
57
    /**
58
     * Create a new group
59
     *
60
     * @param int $dataProviderId
0 ignored issues
show
Missing parameter comment
Loading history...
61
     * @return GroupModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
62
     */
63 2
    public function create(int $dataProviderId): GroupModel
64
    {
65 2
        $groupModel = $this->groupRepository->create($dataProviderId);
66 2
        $this->notify('create', $groupModel);
67 2
        return $groupModel;
68
    }
69
70
    /**
71
     * Delete a group by ID
72
     *
73
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
74
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
75 1
    public function delete(int $id): void
76
    {
77 1
        $groupModel = $this->getById($id);
78 1
        $this->groupRepository->delete($id);
79 1
        $this->notify('delete', $groupModel);
80 1
    }
81
82
    /**
83
     * Update the group model
84
     *
85
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
86
     * @param int $dataProviderId New data provider ID
87
     * @return GroupModel
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
88
     */
89 1
    public function update(int $id, int $dataProviderId): GroupModel
90
    {
91 1
        $oldGroupModel = $this->getById($id);
92 1
        $newGroupModel = $this->groupRepository->update($id, $dataProviderId);
93 1
        $this->notify('update', $oldGroupModel, $newGroupModel);
94 1
        return $newGroupModel;
95
    }
96
97
    /**
98
     * Paginate through all the groups
99
     *
100
     * @param int $page The page number to return
0 ignored issues
show
Expected 4 spaces after parameter name; 1 found
Loading history...
101
     * @param int $perPage The number of results to return per page
102
     *
103
     * @return Collection|GroupModel[]
104
     */
105 2
    public function paginate(int $page, int $perPage): Collection
106
    {
107 2
        return $this->groupRepository->paginate($page, $perPage);
108
    }
109
110
    /**
111
     * Get the number of groups
112
     *
113
     * @return int
114
     */
115 2
    public function count(): int
116
    {
117 2
        return $this->groupRepository->count();
118
    }
119
}