Passed
Pull Request — master (#1)
by Niels
02:42 queued 01:15
created

AccessToken::getTtl()   A

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
namespace Superbrave\AuthZeroHttpClient;
4
5
/**
6
 * Contains the access token and expiry time returned by Auth0.
7
 */
8
class AccessToken
9
{
10
    /**
11
     * @var string
12
     */
13
    private $token;
14
15
    /**
16
     * @var int
17
     */
18
    private $ttl;
19
20
    /**
21
     * Constructs a new AccessToken instance.
22
     *
23
     * @param string $token
24
     * @param int    $ttl
25
     */
26 2
    public function __construct(string $token, int $ttl)
27
    {
28 2
        $this->token = $token;
29 2
        $this->ttl = $ttl;
30 2
    }
31
32
    /**
33
     * @return string
34
     */
35 2
    public function getToken(): string
36
    {
37 2
        return $this->token;
38
    }
39
40
    /**
41
     * @return int
42
     */
43 2
    public function getTtl(): int
44
    {
45 2
        return $this->ttl;
46
    }
47
}
48