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 (32)

src/Auth/User.php (1 issue)

1
<?php
2
3
namespace AloiaCms\Auth;
4
5
use AloiaCms\Models\Contracts\ModelInterface;
6
use AloiaCms\Models\Model;
7
use Illuminate\Contracts\Auth\Authenticatable;
8
9
class User extends Model implements Authenticatable
10
{
11
    protected $folder = 'users';
12
13
    protected $required_fields = [
14
        'identifier'
15
    ];
16
17
    public function findById(string $file_name): ModelInterface
18
    {
19
        $instance = new static();
20
21
        $instance->setFileName($file_name);
22
        $instance->set('identifier', $file_name);
23
24
        return $instance;
25
    }
26
27
    public static function find(string $file_name): ModelInterface
28
    {
29
        $instance = new static();
30
        $instance->setFileName($file_name);
31
        $instance->set('identifier', $file_name);
32
33
        return $instance;
34
    }
35
36
    public function getAuthIdentifierName()
37
    {
38
        return 'identifier';
39
    }
40
41
    public function getAuthIdentifier()
42
    {
43
        return $this->filename();
44
    }
45
46
    public function getAuthPassword()
47
    {
48
        return $this->get('password');
49
    }
50
51
    public function getRememberToken()
52
    {
53
        return $this->get('remember_token');
54
    }
55
56
    public function setRememberToken($value)
57
    {
58
        return $this->set('remember_token', $value);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->set('remember_token', $value) returns the type AloiaCms\Auth\User which is incompatible with the return type mandated by Illuminate\Contracts\Aut...ble::setRememberToken() of void.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
59
    }
60
61
    public function getRememberTokenName()
62
    {
63
        return 'remember_token';
64
    }
65
66
    public function getAuthPasswordName()
67
    {
68
        return 'password';
69
    }
70
}
71