Completed
Pull Request — master (#12)
by
unknown
03:19
created

ResetPassword   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 59
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getUser() 0 4 1
A getPassword() 0 4 1
A passwordConfirmationIsValid() 0 8 2
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