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