Test Failed
Pull Request — master (#7)
by Koen
06:49
created

User::getCurrentToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Models;
6
7
use App\Events\User\Deleting;
8
use Illuminate\Database\Eloquent\Relations\HasMany;
9
use Illuminate\Foundation\Auth\User as Authenticatable;
10
use Illuminate\Notifications\Notifiable;
11
12
final class User extends Authenticatable
13
{
14
    use Notifiable;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Notifications\Notifiable requires the property $email which is not provided by App\Models\User.
Loading history...
15
16
    protected $fillable = [
17
        'name', 'email', 'password',
18
    ];
19
20
    protected $dispatchesEvents = [
21
        'deleting' => Deleting::class,
22
    ];
23
24
    private ?UserToken $currentToken = null;
25
26
    public function tokens(): HasMany
27
    {
28
        return $this->hasMany(UserToken::class);
29
    }
30
31
    public function setCurrentToken(UserToken $token)
32
    {
33
        $this->currentToken = $token;
34
    }
35
36
    public function getCurrentToken()
37
    {
38
        return $this->currentToken;
39
    }
40
}
41