Completed
Pull Request — master (#12)
by
unknown
15:27 queued 12:16
created

PasswordReset::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 1
Metric Value
c 1
b 0
f 1
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
class PasswordReset
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
    public function __construct(UserInterface $user, $password, $passwordConfirmation)
25
    {
26
        $this->user = $user;
27
        $this->password = $password;
28
        $this->passwordConfirmation = $passwordConfirmation;
29
    }
30
31
    public function getUser()
32
    {
33
        return $this->user;
34
    }
35
36
    public function getPassword()
37
    {
38
        return $this->password;
39
    }
40
41
    public function passwordConfirmationIsValid()
42
    {
43
        if ($this->passwordConfirmation !== $this->password) {
44
            return false;
45
        }
46
47
        return true;
48
    }
49
}
50