RefreshToken::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the StfalconApiBundle.
4
 *
5
 * (c) Stfalcon LLC <stfalcon.com>
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 StfalconStudio\ApiBundle\Entity\JWT;
14
15
use Doctrine\ORM\Mapping as ORM;
16
use Gesdinet\JWTRefreshTokenBundle\Entity\AbstractRefreshToken;
17
use Symfony\Component\Validator\Constraints as Assert;
18
19
/**
20
 * RefreshToken.
21
 *
22
 * @ORM\Entity(repositoryClass="Gesdinet\JWTRefreshTokenBundle\Entity\RefreshTokenRepository")
23
 * @ORM\Table(
24
 *     name="jwt_refresh_tokens",
25
 *     uniqueConstraints={
26
 *         @ORM\UniqueConstraint(name="unique_refresh_token", columns={"refresh_token"})
27
 *     },
28
 *     indexes={
29
 *         @ORM\Index(columns={"refresh_token"}),
30
 *     }
31
 * )
32
 */
33
class RefreshToken extends AbstractRefreshToken
34
{
35
    /**
36
     * @var int
37
     *
38
     * @ORM\Column(name="id", type="integer")
39
     * @ORM\Id
40
     * @ORM\GeneratedValue(strategy="AUTO")
41
     */
42
    protected $id;
43
44
    /**
45
     * @var \DateTimeImmutable
46
     *
47
     * @ORM\Column(type="datetimetz_immutable")
48
     *
49
     * @Assert\Type("\DateTimeImmutable")
50
     */
51
    private $createdAt;
52
53
    /**
54
     * Constructor.
55
     */
56
    public function __construct()
57
    {
58
        $this->createdAt = new \DateTimeImmutable('now');
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function getId()
65
    {
66
        return $this->id;
67
    }
68
69
    /**
70
     * @return \DateTimeImmutable
71
     */
72
    public function getCreatedAt(): \DateTimeImmutable
73
    {
74
        return $this->createdAt;
75
    }
76
}
77