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/DataRoleNotifier.php (17 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\Repositories\DataRole as DataRoleRepository;
6
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\Notifier;
7
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\ObserverStore;
8
use Illuminate\Support\Collection;
9
10
class DataRoleNotifier extends Notifier implements DataRoleRepository
0 ignored issues
show
Missing doc comment for class DataRoleNotifier
Loading history...
11
{
12
13
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
14
     * @var DataRoleRepository
15
     */
16
    private $dataRoleRepository;
0 ignored issues
show
Private member variable "dataRoleRepository" must be prefixed with an underscore
Loading history...
17
18 18
    public function __construct(DataRoleRepository $dataRoleRepository, ObserverStore $observerStore)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
19
    {
20 18
        parent::__construct($observerStore, DataRoleRepository::class);
21 18
        $this->dataRoleRepository = $dataRoleRepository;
22 18
    }
23
24
    /**
25
     * Get a data role by ID
26
     *
27
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
28
     * @return \BristolSU\ControlDB\Contracts\Models\DataRole
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
29
     */
30 18
    public function getById(int $id): \BristolSU\ControlDB\Contracts\Models\DataRole
31
    {
32 18
        return $this->dataRoleRepository->getById($id);
33
    }
34
35
    /**
36
     * Get a data role where the given attributes match, including additional attributes.
37
     *
38
     * @param array $attributes
0 ignored issues
show
Missing parameter comment
Loading history...
39
     * @return \BristolSU\ControlDB\Contracts\Models\DataRole
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
40
     */
41
    public function getWhere($attributes = []): \BristolSU\ControlDB\Contracts\Models\DataRole
42
    {
43
        return $this->dataRoleRepository->getWhere($attributes);
44
    }
45
46
    /**
47
     * Get all data roles where the given attributes match, including additional attributes.
48
     *
49
     * @param array $attributes
0 ignored issues
show
Missing parameter comment
Loading history...
50
     * @return Collection|\BristolSU\ControlDB\Contracts\Models\DataRole[]
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
51
     */
52
    public function getAllWhere($attributes = []): Collection
53
    {
54
        return $this->dataRoleRepository->getAllWhere($attributes);
55
    }
56
57
    /**
58
     * Create a data role with the given attributes
59
     *
60
     * @param string|null $roleName Custom name for the role
61
     * @param string|null $email Email of the role
0 ignored issues
show
Expected 4 spaces after parameter name; 1 found
Loading history...
62
     * @return \BristolSU\ControlDB\Contracts\Models\DataRole
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
63
     */
64 2
    public function create(?string $roleName = null, ?string $email = null): \BristolSU\ControlDB\Contracts\Models\DataRole
65
    {
66 2
        $dataRole = $this->dataRoleRepository->create($roleName, $email);
67 2
        $this->notify('create', $dataRole);
68 2
        return $dataRole;
69
    }
70
71
    /**
72
     * Update a role with the given attributes
73
     *
74
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
Expected 9 spaces after parameter type; 1 found
Loading history...
75
     * @param string|null $roleName Name of the role
76
     * @param string|null $email Email of the role
0 ignored issues
show
Expected 4 spaces after parameter name; 1 found
Loading history...
77
     * @return \BristolSU\ControlDB\Contracts\Models\DataRole
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
78
     */
79 4
    public function update(int $id, ?string $roleName = null, ?string $email = null): \BristolSU\ControlDB\Contracts\Models\DataRole
80
    {
81 4
        $oldDataRole = $this->getById($id);
82 4
        $newDataRole = $this->dataRoleRepository->update($id, $roleName, $email);
83 4
        $this->notify('update', $oldDataRole, $newDataRole);
84 4
        return $newDataRole;
85
    }
86
    
87
    
88
}