Completed
Push — master ( 02cfb9...95b30c )
by Artem
06:06
created

AbstractJwtPayload::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
/*
3
 * This file is part of the FreshCentrifugoBundle.
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\CentrifugoBundle\Token;
14
15
/**
16
 * AbstractJwtPayload.
17
 *
18
 * @author Artem Henvald <[email protected]>
19
 */
20
abstract class AbstractJwtPayload implements JwtPayloadInterface
21
{
22
    /** @var int|null */
23
    private $expirationTime;
24
25
    /** @var array */
26
    private $info;
27
28
    /** @var string|null */
29
    private $base64info; // phpcs:ignore
30
31
    /**
32
     * @param array       $info
33
     * @param int|null    $expirationTime
34
     * @param string|null $base64info
35
     */
36
    public function __construct(array $info = [], ?int $expirationTime = null, ?string $base64info = null)
37
    {
38
        $this->info = $info;
39
        $this->expirationTime = $expirationTime;
40
        $this->base64info = $base64info;
41
    }
42
43
    /**
44
     * @return int|null
45
     */
46
    public function getExpirationTime(): ?int
47
    {
48
        return $this->expirationTime;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public function getInfo(): array
55
    {
56
        return $this->info;
57
    }
58
59
    /**
60
     * @return string|null
61
     */
62
    public function getBase64Info(): ?string
63
    {
64
        return $this->base64info;
65
    }
66
}
67