Base   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 104
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 104
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 97 1
A init() 0 3 1
1
<?php
2
3
namespace LmcUser\Form;
4
5
use Laminas\Form\Element;
6
7
class Base extends ProvidesEventsForm
8
{
9
    public function __construct($name = null)
10
    {
11
        parent::__construct($name);
12
13
        $this->add(
14
            array(
15
            'name' => 'username',
16
            'options' => array(
17
                'label' => 'Username',
18
            ),
19
            'attributes' => array(
20
                'type' => 'text'
21
            ),
22
            )
23
        );
24
25
        $this->add(
26
            array(
27
            'name' => 'email',
28
            'options' => array(
29
                'label' => 'Email',
30
            ),
31
            'attributes' => array(
32
                'type' => 'text'
33
            ),
34
            )
35
        );
36
37
        $this->add(
38
            array(
39
            'name' => 'display_name',
40
            'options' => array(
41
                'label' => 'Display Name',
42
            ),
43
            'attributes' => array(
44
                'type' => 'text'
45
            ),
46
            )
47
        );
48
49
        $this->add(
50
            array(
51
            'name' => 'password',
52
            'type' => 'password',
53
            'options' => array(
54
                'label' => 'Password',
55
            ),
56
            'attributes' => array(
57
                'type' => 'password'
58
            ),
59
            )
60
        );
61
62
        $this->add(
63
            array(
64
            'name' => 'passwordVerify',
65
            'type' => 'password',
66
            'options' => array(
67
                'label' => 'Password Verify',
68
            ),
69
            'attributes' => array(
70
                'type' => 'password'
71
            ),
72
            )
73
        );
74
75
        $submitElement = new Element\Button('submit');
76
        $submitElement
77
            ->setLabel('Submit')
78
            ->setAttributes(
79
                array(
80
                'type'  => 'submit',
81
                )
82
            );
83
84
        $this->add(
85
            $submitElement,
86
            array(
87
            'priority' => -100,
88
            )
89
        );
90
91
        $this->add(
92
            array(
93
            'name' => 'userId',
94
            'type' => 'Laminas\Form\Element\Hidden',
95
            'attributes' => array(
96
                'type' => 'hidden'
97
            ),
98
            )
99
        );
100
101
        // @TODO: Fix this... getValidator() is a protected method.
102
        //$csrf = new Element\Csrf('csrf');
103
        //$csrf->getValidator()->setTimeout($this->getRegistrationOptions()->getUserFormTimeout());
104
        //$this->add($csrf);
105
    }
106
107
    public function init()
108
    {
109
    }
110
}
111