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/Traits/DataPositionTrait.php (13 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
4
namespace BristolSU\ControlDB\Traits;
5
6
7
use BristolSU\ControlDB\Contracts\Models\Position;
8
use BristolSU\ControlDB\Contracts\Repositories\DataPosition;
9
use Illuminate\Database\Eloquent\ModelNotFoundException;
10
11
/**
12
 * Implements methods to the data position interface using repositories
13
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
14
trait DataPositionTrait
15
{
16
17
    /**
18
     * Get the position using the data position
19
     *
20
     * @return Position|null
21
     */
22 2
    public function position(): ?Position
23
    {
24
        try {
25 2
            return app(\BristolSU\ControlDB\Contracts\Repositories\Position::class)->getByDataProviderId($this->id());
0 ignored issues
show
It seems like id() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
            return app(\BristolSU\ControlDB\Contracts\Repositories\Position::class)->getByDataProviderId($this->/** @scrutinizer ignore-call */ id());
Loading history...
26 1
        } catch (ModelNotFoundException $e) {
27 1
            return null;
28
        }
29
    }
30
31
    /**
32
     * Set the position name
33
     *
34
     * @param string|null $name
0 ignored issues
show
Missing parameter comment
Loading history...
35
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
36 2
    public function setName(?string $name): void
37
    {
38 2
        app(DataPosition::class)->update($this->id(), $name, $this->description());
0 ignored issues
show
It seems like description() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        app(DataPosition::class)->update($this->id(), $name, $this->/** @scrutinizer ignore-call */ description());
Loading history...
39 2
    }
40
41
    /**
42
     * Set the description
43
     *
44
     * @param string|null $description
0 ignored issues
show
Missing parameter comment
Loading history...
45
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
46 2
    public function setDescription(?string $description): void
47
    {
48 2
        app(DataPosition::class)->update($this->id(), $this->name(), $description);
0 ignored issues
show
It seems like name() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

48
        app(DataPosition::class)->update($this->id(), $this->/** @scrutinizer ignore-call */ name(), $description);
Loading history...
49
50
    }
51
}