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/DataUserTrait.php (22 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\User;
8
use DateTime;
9
use Illuminate\Database\Eloquent\ModelNotFoundException;
10
11
/**
12
 * Implements methods to the data user 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 DataUserTrait
15
{
16
17
    /**
18
     * Get the user using the data user
19
     *
20
     * @return User|null
21
     */
22 2
    public function user(): ?User
23
    {
24
        try {
25 2
            return app(\BristolSU\ControlDB\Contracts\Repositories\User::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\User::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 users first name
33
     *
34
     * @param string|null $firstName
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 setFirstName(?string $firstName): void
37
    {
38 2
        app(\BristolSU\ControlDB\Contracts\Repositories\DataUser::class)->update(
39 2
            $this->id(), $firstName, $this->lastName(), $this->email(), $this->dob(), $this->preferredName()
0 ignored issues
show
It seems like lastName() 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

39
            $this->id(), $firstName, $this->/** @scrutinizer ignore-call */ lastName(), $this->email(), $this->dob(), $this->preferredName()
Loading history...
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

39
            $this->id(), $firstName, $this->lastName(), $this->/** @scrutinizer ignore-call */ email(), $this->dob(), $this->preferredName()
Loading history...
It seems like preferredName() 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

39
            $this->id(), $firstName, $this->lastName(), $this->email(), $this->dob(), $this->/** @scrutinizer ignore-call */ preferredName()
Loading history...
It seems like dob() 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

39
            $this->id(), $firstName, $this->lastName(), $this->email(), $this->/** @scrutinizer ignore-call */ dob(), $this->preferredName()
Loading history...
40
        );
41 2
    }
42
43
    /**
44
     * Set the users last name
45
     *
46
     * @param string|null $lastName
0 ignored issues
show
Missing parameter comment
Loading history...
47
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
48 2
    public function setLastName(?string $lastName): void
49
    {
50 2
        app(\BristolSU\ControlDB\Contracts\Repositories\DataUser::class)->update(
51 2
            $this->id(), $this->firstName(), $lastName, $this->email(), $this->dob(), $this->preferredName()
0 ignored issues
show
It seems like firstName() 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

51
            $this->id(), $this->/** @scrutinizer ignore-call */ firstName(), $lastName, $this->email(), $this->dob(), $this->preferredName()
Loading history...
52
        );
53 2
    }
54
55
    /**
56
     * Set the users email
57
     *
58
     * @param string|null $email
0 ignored issues
show
Missing parameter comment
Loading history...
59
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
60 2
    public function setEmail(?string $email): void
61
    {
62 2
        app(\BristolSU\ControlDB\Contracts\Repositories\DataUser::class)->update(
63 2
            $this->id(), $this->firstName(), $this->lastName(), $email, $this->dob(), $this->preferredName()
64
        );
65 2
    }
66
67
    /**
68
     * Set the date of birth attribute
69
     *
70
     * @param DateTime|null $dob
0 ignored issues
show
Missing parameter comment
Loading history...
71
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
72 2
    public function setDob(?DateTime $dob): void
73
    {
74 2
        app(\BristolSU\ControlDB\Contracts\Repositories\DataUser::class)->update(
75 2
            $this->id(), $this->firstName(), $this->lastName(), $this->email(), $dob, $this->preferredName()
76
        );
77 2
    }
78
79
    /**
80
     * Set the preferred name for the user
81
     *
82
     * @param string|null $name
0 ignored issues
show
Missing parameter comment
Loading history...
83
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
84 2
    public function setPreferredName(?string $name): void
85
    {
86 2
        app(\BristolSU\ControlDB\Contracts\Repositories\DataUser::class)->update(
87 2
            $this->id(), $this->firstName(), $this->lastName(), $this->email(), $this->dob(), $name
88
        );
89
    }
90
}