Token   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A newFactory() 0 3 1
1
<?php
2
3
/**
4
 * Token.
5
 */
6
7
namespace Bmatovu\MtnMomo\Models;
8
9
use Bmatovu\MtnMomo\Database\Factories\TokenFactory;
10
use Bmatovu\MtnMomo\Traits\TokenUtilTrait;
11
use Bmatovu\OAuthNegotiator\Models\TokenInterface;
12
use Illuminate\Database\Eloquent\Factories\HasFactory;
13
use Illuminate\Database\Eloquent\Model as BaseModel;
14
use Illuminate\Database\Eloquent\SoftDeletes;
15
16
/**
17
 * Token model.
18
 */
19
class Token extends BaseModel implements TokenInterface
20
{
21
    use HasFactory, SoftDeletes, TokenUtilTrait;
0 ignored issues
show
introduced by
The trait Bmatovu\MtnMomo\Traits\TokenUtilTrait requires some properties which are not provided by Bmatovu\MtnMomo\Models\Token: $access_token, $refresh_token, $token_type, $expires_at, $product
Loading history...
22
23
    /**
24
     * The table associated with the model.
25
     *
26
     * @var string
27
     */
28
    protected $table = 'mtn_momo_tokens';
29
30
    /**
31
     * The attributes that are mass assignable.
32
     *
33
     * @var array
34
     */
35
    protected $fillable = [
36
        'access_token',
37
        'refresh_token',
38
        'token_type',
39
        'product',
40
        'expires_at',
41
    ];
42
43
    /**
44
     * The attributes that should be mutated to dates.
45
     *
46
     * @var array
47
     */
48
    protected $casts = [
49
        'created_at' => 'datetime',
50
        'updated_at' => 'datetime',
51
        'expires_at' => 'datetime',
52
        'deleted_at' => 'datetime',
53
    ];
54
55
    /**
56
     * Create a new factory instance for the model.
57
     *
58
     * @return \Illuminate\Database\Eloquent\Factories\Factory
59
     */
60 7
    public static function newFactory()
61
    {
62 7
        return TokenFactory::new();
63
    }
64
}
65