TokenUtilTrait::getTokenType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * TokenUtilTrait.
5
 */
6
7
namespace Bmatovu\MtnMomo\Traits;
8
9
/**
10
 * Token model utilities.
11
 */
12
trait TokenUtilTrait
13
{
14
    /**
15
     * Get access token.
16
     *
17
     * @return string
18
     */
19 4
    public function getAccessToken()
20
    {
21 4
        return $this->access_token;
22
    }
23
24
    /**
25
     * Get refresh token.
26
     *
27
     * @return string|null
28
     */
29 2
    public function getRefreshToken()
30
    {
31 2
        return $this->refresh_token;
32
    }
33
34
    /**
35
     * Get token type.
36
     *
37
     * @return string
38
     */
39 2
    public function getTokenType()
40
    {
41 2
        return $this->token_type;
42
    }
43
44
    /**
45
     * Get product.
46
     *
47
     * @return string
48
     */
49 1
    public function getProduct()
50
    {
51 1
        return $this->product;
52
    }
53
54
    /**
55
     * Get expires at.
56
     *
57
     * @return string|\Datetime
58
     */
59 2
    public function getExpiresAt()
60
    {
61 2
        return $this->expires_at;
62
    }
63
64
    /**
65
     * Determine if a token is expired.
66
     *
67
     * @return bool
68
     */
69 1
    public function isExpired()
70
    {
71 1
        if (is_null($this->expires_at)) {
72 1
            return false;
73
        }
74
75 1
        return $this->expires_at->isPast();
76
    }
77
}
78