Passed
Push — master ( 6d5e0e...7d440c )
by Niels
04:06 queued 57s
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
 * @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