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

Dispense::getToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
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 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