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)

Observers/NotifyObservers/DataPositionNotifier.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\DataPosition as DataPositionRepository;
6
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\Notifier;
7
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\ObserverStore;
8
use Illuminate\Support\Collection;
9
10
class DataPositionNotifier extends Notifier implements DataPositionRepository
0 ignored issues
show
Missing doc comment for class DataPositionNotifier
Loading history...
11
{
12
13
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
14
     * @var DataPositionRepository
15
     */
16
    private $dataPositionRepository;
0 ignored issues
show
Private member variable "dataPositionRepository" must be prefixed with an underscore
Loading history...
17
18 13
    public function __construct(DataPositionRepository $dataPositionRepository, ObserverStore $observerStore)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
19
    {
20 13
        parent::__construct($observerStore, DataPositionRepository::class);
21 13
        $this->dataPositionRepository = $dataPositionRepository;
22 13
    }
23
24
    /**
25
     * Get a data position by ID
26
     *
27
     * @param int $id
0 ignored issues
show
Missing parameter comment
Loading history...
28
     * @return \BristolSU\ControlDB\Contracts\Models\DataPosition
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
29
     */
30 13
    public function getById(int $id): \BristolSU\ControlDB\Contracts\Models\DataPosition
31
    {
32 13
        return $this->dataPositionRepository->getById($id);
33
    }
34
35
    /**
36
     * Get a data position 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\DataPosition
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\DataPosition
42
    {
43
        return $this->dataPositionRepository->getWhere($attributes);
44
    }
45
46
    /**
47
     * Get all data positions 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\DataPosition[]
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->dataPositionRepository->getAllWhere($attributes);
55
    }
56
57
    /**
58
     * Create a data position with the given attributes
59
     *
60
     * @param string|null $name Name of the position
0 ignored issues
show
Expected 8 spaces after parameter name; 1 found
Loading history...
61
     * @param string|null $description Description of the position
62
     * @return \BristolSU\ControlDB\Contracts\Models\DataPosition
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 $name = null, ?string $description = null): \BristolSU\ControlDB\Contracts\Models\DataPosition
65
    {
66 2
        $dataPosition = $this->dataPositionRepository->create($name, $description);
67 2
        $this->notify('create', $dataPosition);
68 2
        return $dataPosition;
69
    }
70
71
    /**
72
     * Update a data position 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 $name Name of the position
0 ignored issues
show
Expected 8 spaces after parameter name; 1 found
Loading history...
76
     * @param string|null $description Description of the position
77
     * @return \BristolSU\ControlDB\Contracts\Models\DataPosition
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 $name = null, ?string $description = null): \BristolSU\ControlDB\Contracts\Models\DataPosition
80
    {
81 4
        $oldDataPosition = $this->getById($id);
82 4
        $newDataPosition = $this->dataPositionRepository->update($id, $name, $description);
83 4
        $this->notify('update', $oldDataPosition, $newDataPosition);
84 4
        return $newDataPosition;
85
    }
86
}