Passed
Push — master ( a50549...138a43 )
by Koen
03:13
created

Dispense   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExpiresAt() 0 3 1
A getToken() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Models;
6
7
use Carbon\Carbon;
8
use Illuminate\Database\Eloquent\Model;
9
10
final class Dispense extends Model
11
{
12
    protected $fillable = [
13
        'key', 'token', 'exipres_at',
14
    ];
15
16
    protected $dates = [
17
        'expires_at',
18
    ];
19
20
    public function getExpiresAt(): Carbon
21
    {
22
        return $this->getAttributeValue('expires_at');
23
    }
24
25
    public function getToken(): string
26
    {
27
        return $this->getAttributeValue('token');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getAttributeValue('token') could return the type boolean|null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
28
    }
29
}
30