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.
Passed
Push — master ( c3473e...4f372f )
by Ahsan Muhammad
02:06
created

WordpressUser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace MrShan0\WordpressAuth\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Foundation\Auth\User as Authenticatable;
7
use Illuminate\Notifications\Notifiable;
8
use Illuminate\Support\Str;
9
10
class WordpressUser extends Authenticatable
11
{
12
    use Notifiable;
0 ignored issues
show
introduced by
The trait Illuminate\Notifications\Notifiable requires some properties which are not provided by MrShan0\WordpressAuth\Models\WordpressUser: $email, $phone_number
Loading history...
13
14
    /**
15
     * Explicitly define your table name
16
     *
17
     * @var string
18
     */
19
    protected $table = 'users';
20
21
    /**
22
     * Disable timestamps
23
     *
24
     * @var boolean
25
     */
26
    public $timestamps = false;
27
28
    /**
29
     * Define primary key
30
     *
31
     * @var string
32
     */
33
    protected $primaryKey = 'ID';
34
35
    /**
36
     * The column name of the "remember me" token.
37
     *
38
     * @var string
39
     */
40
    protected $rememberTokenName = false;
41
42
    /**
43
     * The attributes that should be mutated to dates.
44
     *
45
     * @var array
46
     */
47
    protected $dates = [
48
        'user_registered',
49
    ];
50
51
    /**
52
     * The attributes that should be hidden for arrays.
53
     *
54
     * @var array
55
     */
56
    protected $hidden = [
57
        'user_pass',
58
        'remember_token', // disabled via protected property
59
    ];
60
61
    /**
62
     * The attributes that are mass assignable.
63
     *
64
     * @var array
65
     */
66
    protected $fillable = [
67
        'user_login',
68
        'user_pass',
69
        'user_nicename',
70
        'user_email',
71
        'user_url',
72
        'user_registered',
73
        'user_activation_key',
74
        'user_status',
75
        'display_name',
76
    ];
77
78
    /**
79
     * Create a new Eloquent model instance.
80
     *
81
     * @param  array  $attributes
82
     * @return void
83
     */
84
    public function __construct(array $attributes = [])
85
    {
86
        parent::__construct($attributes);
87
88
        // Set connection from config
89
        $this->setConnection(config('wordpress-auth.connection', 'mysql'));
90
    }
91
92
    /**
93
     * Get the e-mail address where password reset links are sent.
94
     *
95
     * @return string
96
     */
97
    public function getEmailForPasswordReset()
98
    {
99
        return $this->user_email;
0 ignored issues
show
Bug introduced by
The property user_email does not seem to exist on MrShan0\WordpressAuth\Models\WordpressUser. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
100
    }
101
102
    /**
103
     * Return password value
104
     *
105
     * @return string
106
     */
107
    public function getAuthPassword()
108
    {
109
        return $this->user_pass;
0 ignored issues
show
Bug introduced by
The property user_pass does not seem to exist on MrShan0\WordpressAuth\Models\WordpressUser. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
110
    }
111
112
    /**
113
     * Usage for notifiable for email
114
     *
115
     * @return string
116
     */
117
    public function routeNotificationForMail()
118
    {
119
        return $this->getEmailForPasswordReset();
120
    }
121
}
122