StoredJwtToken   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 30
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tokenable() 0 3 1
A getTable() 0 3 1
1
<?php
2
3
4
namespace JWTAuth\Eloquent;
5
6
use Illuminate\Database\Eloquent\Model;
7
8
/**
9
 * Used to cache data and debug after
10
 *
11
 * Class StoredJwtToken
12
 * @package JWTAuth\Eloquent
13
14
 */
15
class StoredJwtToken extends Model
16
{
17
    /**
18
     * @inheritdoc
19
     */
20
    protected $guarded = [];
21
22
    /**
23
     * @inheritdoc
24
     */
25
    protected $casts = [
26
        'abilities' => 'json',
27
    ];
28
29
    /**
30
     * @inheritDoc
31
     */
32 8
    public function getTable(): string
33
    {
34 8
        return config('jwt-auth.tables.tokens', parent::getTable());
35
    }
36
37
    /**
38
     * Get model used token
39
     *
40
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
41
     */
42 1
    public function tokenable(): \Illuminate\Database\Eloquent\Relations\MorphTo
43
    {
44 1
        return $this->morphTo('tokenable');
45
    }
46
}
47