Passed
Push — master ( 700b0f...aafb0a )
by Björn
18:25 queued 10s
created

UserProfileForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 135
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 135
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 132 1
1
<?php
2
/**
3
 * BB's Zend Framework 2 Components
4
 * 
5
 * AdminModule
6
 *
7
 * @package   [MyApplication]
8
 * @package   BB's Zend Framework 2 Components
9
 * @package   AdminModule
10
 * @author    Björn Bartels <[email protected]>
11
 * @link      https://gitlab.bjoernbartels.earth/groups/zf2
12
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
13
 * @copyright copyright (c) 2016 Björn Bartels <[email protected]>
14
 */
15
16
namespace Admin\Form;
17
18
use Zend\Form\Form;
19
20
class UserProfileForm extends Form
21
{
22
    public function __construct($name = null)
23
    {
24
        // we want to ignore the name passed
25
        parent::__construct('userprofile');
26
        $this->setAttribute('method', 'post');
27
        $this->add(
28
            array(
29
            'name' => 'user_id',
30
            'attributes' => array(
31
            'type'  => 'hidden',
32
            ),
33
            )
34
        );
35
        $this->add(
36
            array(
37
            'name' => 'street',
38
            'attributes' => array(
39
            'type'  => 'text',
40
            ),
41
            'options' => array(
42
            'label' => 'street',
43
            ),
44
            )
45
        );
46
        $this->add(
47
            array(
48
            'name' => 'city',
49
            'attributes' => array(
50
            'type'  => 'text',
51
            ),
52
            'options' => array(
53
            'label' => 'city',
54
            ),
55
            )
56
        );
57
        $this->add(
58
            array(
59
            'name' => 'phone',
60
            'attributes' => array(
61
            'type'  => 'text',
62
            ),
63
            'options' => array(
64
            'label' => 'phone',
65
            ),
66
            )
67
        );
68
        $this->add(
69
            array(
70
            'name' => 'cell',
71
            'attributes' => array(
72
            'type'  => 'text',
73
            ),
74
            'options' => array(
75
            'label' => 'mobile',
76
            ),
77
            )
78
        );
79
        
80
81
        $this->add(
82
            array(
83
            'name' => 'facebook',
84
            'attributes' => array(
85
                   'type'  => 'url',
86
               ),
87
               'options' => array(
88
                   'label' => 'Facebook',
89
               ),
90
            )
91
        );
92
        $this->add(
93
            array(
94
            'name' => 'twitter',
95
            'attributes' => array(
96
            'type'  => 'url',
97
            ),
98
            'options' => array(
99
            'label' => 'Twitter',
100
            ),
101
            )
102
        );
103
        $this->add(
104
            array(
105
            'name' => 'skype',
106
            'attributes' => array(
107
            'type'  => 'text',
108
            ),
109
            'options' => array(
110
            'label' => 'Skype',
111
            ),
112
            )
113
        );
114
        $this->add(
115
            array(
116
            'name' => 'icq',
117
            'attributes' => array(
118
            'type'  => 'number',
119
            ),
120
            'options' => array(
121
            'label' => 'ICQ',
122
            ),
123
            )
124
        );
125
        
126
        $this->add(
127
            array(
128
            'name' => 'submit',
129
            'attributes' => array(
130
            'type'  => 'submit',
131
            'value' => 'save',
132
            'id' => 'submitbutton',
133
            ),
134
            'options' => array(
135
            'label' => 'save',
136
            ),
137
            )
138
        );
139
        
140
        $this->add(
141
            array(
142
            'name' => 'reset',
143
            'attributes' => array(
144
            'type'  => 'reset',
145
            'value' => 'reset',
146
            'id' => 'resetbutton',
147
            ),
148
            'options' => array(
149
            'label' => 'reset',
150
            ),
151
            )
152
        );
153
    }
154
}