Base   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

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