Completed
Pull Request — master (#12)
by
unknown
04:38 queued 01:55
created

ResetPassword::passwordConfirmationIsValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace SumoCoders\FrameworkMultiUserBundle\Command;
4
5
use SumoCoders\FrameworkMultiUserBundle\User\UserInterface;
6
7
final class ResetPassword
8
{
9
    /**
10
     * @var UserInterface
11
     */
12
    private $user;
13
14
    /**
15
     * @var string
16
     */
17
    private $password;
18
19
    /**
20
     * @var string
21
     */
22
    private $passwordConfirmation;
23
24
    /**
25
     * ResetPassword constructor.
26
     *
27
     * @param UserInterface $user
28
     * @param $password
29
     * @param $passwordConfirmation
30
     */
31
    public function __construct(UserInterface $user, $password, $passwordConfirmation)
32
    {
33
        $this->user = $user;
34
        $this->password = $password;
35
        $this->passwordConfirmation = $passwordConfirmation;
36
    }
37
38
    /**
39
     * @return UserInterface
40
     */
41
    public function getUser()
42
    {
43
        return $this->user;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getPassword()
50
    {
51
        return $this->password;
52
    }
53
54
    /**
55
     * @return bool
56
     */
57
    public function passwordConfirmationIsValid()
58
    {
59
        if ($this->passwordConfirmation !== $this->password) {
60
            return false;
61
        }
62
63
        return true;
64
    }
65
}
66