Passed
Pull Request — master (#1)
by Niels
01:29
created

AccessToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getToken() 0 3 1
A getTtl() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Superbrave\AuthZeroHttpClient;
4
5
/**
6
 * Contains the access token and expiry time returned by Auth0.
7
 *
8
 * @author Niels Nijens <[email protected]>
9
 */
10
class AccessToken
11
{
12
    /**
13
     * @var string
14
     */
15
    private $token;
16
17
    /**
18
     * @var int
19
     */
20
    private $ttl;
21
22
    /**
23
     * Constructs a new AccessToken instance.
24
     *
25
     * @param string $token
26
     * @param int    $ttl
27
     */
28 2
    public function __construct(string $token, int $ttl)
29
    {
30 2
        $this->token = $token;
31 2
        $this->ttl = $ttl;
32 2
    }
33
34
    /**
35
     * @return string
36
     */
37 2
    public function getToken(): string
38
    {
39 2
        return $this->token;
40
    }
41
42
    /**
43
     * @return int
44
     */
45 2
    public function getTtl(): int
46
    {
47 2
        return $this->ttl;
48
    }
49
}
50