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/DataRoleTrait.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\Role;
8
use BristolSU\ControlDB\Contracts\Repositories\DataRole;
9
use Illuminate\Database\Eloquent\ModelNotFoundException;
10
11
/**
12
 * Implements methods to the data role 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 DataRoleTrait
15
{
16
17
    /**
18
     * Get the role using the data role
19
     *
20
     * @return Role|null
21
     */
22 2
    public function role(): ?Role
23
    {
24
        try {
25 2
            return app(\BristolSU\ControlDB\Contracts\Repositories\Role::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\Role::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 email of the role
33
     *
34
     * @param string|null $email
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 setEmail(?string $email): void
37
    {
38 2
        app(DataRole::class)->update($this->id(), $this->roleName(), $email);
0 ignored issues
show
It seems like roleName() 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(DataRole::class)->update($this->id(), $this->/** @scrutinizer ignore-call */ roleName(), $email);
Loading history...
39 2
    }
40
41
42
    /**
43
     * Set a name for the role
44
     *
45
     * @param string|null $roleName
0 ignored issues
show
Missing parameter comment
Loading history...
46
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
47 2
    public function setRoleName(?string $roleName): void
48
    {
49 2
        app(DataRole::class)->update($this->id(), $roleName, $this->email());
0 ignored issues
show
It seems like email() 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

49
        app(DataRole::class)->update($this->id(), $roleName, $this->/** @scrutinizer ignore-call */ email());
Loading history...
50
51
    }
52
}