ResetPasswordRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 3 1
A getUser() 0 3 1
1
<?php
2
3
namespace App\Entity;
4
5
use App\Repository\ResetPasswordRequestRepository;
6
use Doctrine\ORM\Mapping as ORM;
7
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface;
8
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestTrait;
9
10
/**
11
 * @ORM\Entity(repositoryClass=ResetPasswordRequestRepository::class)
12
 */
13
class ResetPasswordRequest implements ResetPasswordRequestInterface
14
{
15
    use ResetPasswordRequestTrait;
16
17
    /**
18
     * @ORM\Id
19
     * @ORM\GeneratedValue
20
     * @ORM\Column(type="integer")
21
     */
22
    private $id;
23
24
    /**
25
     * @ORM\ManyToOne(targetEntity=User::class)
26
     * @ORM\JoinColumn(nullable=false)
27
     */
28
    private $user;
29
30
    public function __construct(object $user, \DateTimeInterface $expiresAt, string $selector, string $hashedToken)
31
    {
32
        $this->user = $user;
33
        $this->initialize($expiresAt, $selector, $hashedToken);
34
    }
35
36
    public function getId(): ?int
37
    {
38
        return $this->id;
39
    }
40
41
    public function getUser(): object
42
    {
43
        return $this->user;
44
    }
45
}
46