Passed
Push — master ( aad9e9...893d1e )
by Kirill
04:12
created

TestAuthToken::getExpiresAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Auth\Stub;
13
14
use Spiral\Auth\TokenInterface;
15
16
class TestAuthToken implements TokenInterface
17
{
18
    /** @var string */
19
    private $id;
20
21
    /** @var \DateTimeInterface|null */
22
    private $expiresAt;
23
24
    /** @var array */
25
    private $payload;
26
27
    /**
28
     * @param string                  $id
29
     * @param array                   $payload
30
     * @param \DateTimeInterface|null $expiresAt
31
     */
32
    public function __construct(string $id, array $payload, \DateTimeInterface $expiresAt = null)
33
    {
34
        $this->id = $id;
35
        $this->expiresAt = $expiresAt;
36
        $this->payload = $payload;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function getID(): string
43
    {
44
        return $this->id;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function getExpiresAt(): ?\DateTimeInterface
51
    {
52
        return $this->expiresAt;
53
    }
54
55
    /**
56
     * @inheritDoc
57
     */
58
    public function getPayload(): array
59
    {
60
        return $this->payload;
61
    }
62
}
63