ChangePassword   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 97
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 66 1
A setAuthenticationOptions() 0 6 1
A getAuthenticationOptions() 0 4 1
1
<?php
2
3
namespace LmcUser\Form;
4
5
use LmcUser\Options\AuthenticationOptionsInterface;
6
7
class ChangePassword extends ProvidesEventsForm
8
{
9
    /**
10
     * @var AuthenticationOptionsInterface
11
     */
12
    protected $authOptions;
13
14
    public function __construct($name, AuthenticationOptionsInterface $options)
15
    {
16
        $this->setAuthenticationOptions($options);
17
18
        parent::__construct($name);
19
20
        $this->add(
21
            array(
22
            'name' => 'identity',
23
            'options' => array(
24
                'label' => '',
25
            ),
26
            'attributes' => array(
27
                'type' => 'hidden'
28
            ),
29
            )
30
        );
31
32
        $this->add(
33
            array(
34
            'name' => 'credential',
35
            'type' => 'password',
36
            'options' => array(
37
                'label' => 'Current Password',
38
            ),
39
            'attributes' => array(
40
                'type' => 'password',
41
            ),
42
            )
43
        );
44
45
        $this->add(
46
            array(
47
            'name' => 'newCredential',
48
            'options' => array(
49
                'label' => 'New Password',
50
            ),
51
            'attributes' => array(
52
                'type' => 'password',
53
            ),
54
            )
55
        );
56
57
        $this->add(
58
            array(
59
            'name' => 'newCredentialVerify',
60
            'type' => 'password',
61
            'options' => array(
62
                'label' => 'Verify New Password',
63
            ),
64
            'attributes' => array(
65
                'type' => 'password',
66
            ),
67
            )
68
        );
69
70
        $this->add(
71
            array(
72
            'name' => 'submit',
73
            'attributes' => array(
74
                'value' => 'Submit',
75
                'type'  => 'submit'
76
            ),
77
            )
78
        );
79
    }
80
81
    /**
82
     * Set Authentication-related Options
83
     *
84
     * @param  AuthenticationOptionsInterface $authOptions
85
     * @return ChangePassword
86
     */
87
    public function setAuthenticationOptions(AuthenticationOptionsInterface $authOptions)
88
    {
89
        $this->authOptions = $authOptions;
90
91
        return $this;
92
    }
93
94
    /**
95
     * Get Authentication-related Options
96
     *
97
     * @return AuthenticationOptionsInterface
98
     */
99
    public function getAuthenticationOptions()
100
    {
101
        return $this->authOptions;
102
    }
103
}
104