Completed
Push — 1.0 ( 4b07bc...bb4e0d )
by David
06:01
created

ResetPasswordView::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Mouf\Security\Password;
4
5
use Mouf\Html\HtmlElement\HtmlElementInterface;
6
use Mouf\Html\Renderer\Renderable;
7
8
class ResetPasswordView implements HtmlElementInterface
9
{
10
    use Renderable;
11
12
    /**
13
     * @var string
14
     */
15
    private $token;
16
17
    /**
18
     * @var string
19
     */
20
    private $passwordRules;
21
22
    /**
23
     * @var bool
24
     */
25
    private $displayMismatchPassword;
26
27
    /**
28
     * @var bool
29
     */
30
    private $displayPoorPassword;
31
32
    /**
33
     * ResetPasswordView constructor.
34
     *
35
     * @param $token
36
     * @param $passwordRules
37
     */
38
    public function __construct(string $token, string $passwordRules)
39
    {
40
        $this->token = $token;
41
        $this->passwordRules = $passwordRules;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getToken(): string
48
    {
49
        return $this->token;
50
    }
51
52
    /**
53
     * @param bool $displayMismatchPassword
54
     *
55
     * @return ResetPasswordView
56
     */
57
    public function withDisplayMismatchPassword(bool $displayMismatchPassword = true) : ResetPasswordView
58
    {
59
        $clone = clone $this;
60
        $clone->displayMismatchPassword = $displayMismatchPassword;
61
62
        return $clone;
63
    }
64
65
    /**
66
     * @param bool $displayPoorPassword
67
     *
68
     * @return ResetPasswordView
69
     */
70
    public function withDisplayPoorPassword(bool $displayPoorPassword = true) : ResetPasswordView
71
    {
72
        $clone = clone $this;
73
        $clone->displayPoorPassword = $displayPoorPassword;
74
75
        return $clone;
76
    }
77
}
78