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

PasswordReset   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 5
c 2
b 1
f 1
lcom 1
cbo 0
dl 0
loc 43
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
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