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

ApplicationsForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 122
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 122
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 119 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
use Admin\Module;
20
21
class ApplicationsForm extends Form
22
{
23
    public function __construct($name = null)
24
    {
25
        
26
        // we want to ignore the name passed
27
        parent::__construct('applications');
28
        $oModule = new Module();
29
        $cfg = $oModule->getConfig();
0 ignored issues
show
Unused Code introduced by
$cfg is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
30
        
31
        $this->setAttribute('method', 'post');
32
        $this->add(
33
            array(
34
            'name' => 'application_id',
35
            'attributes' => array(
36
            'type'  => 'hidden',
37
            ),
38
            )
39
        );
40
        $this->add(
41
            array(
42
            'name' => 'name',
43
            'attributes' => array(
44
            'type'  => 'text',
45
            ),
46
            'options' => array(
47
            'label' => 'name',
48
            ),
49
            )
50
        );
51
        $this->add(
52
            array(
53
            'name' => 'shortname',
54
            'attributes' => array(
55
            'type'  => 'text',
56
            ),
57
            'options' => array(
58
            'label' => 'shortname',
59
            ),
60
            )
61
        );
62
        $this->add(
63
            array(
64
            'name' => 'path',
65
            'type'  => 'text',
66
            'attributes' => array(
67
            'type'  => 'text',
68
            ),
69
            'options' => array(
70
            'label' => 'path',
71
            ),
72
            )
73
        );
74
        $this->add(
75
            array(
76
            'name' => 'url',
77
            'type'  => 'url',
78
            'attributes' => array(
79
            'type'  => 'url',
80
            ),
81
            'options' => array(
82
            'label' => 'url',
83
            ),
84
            )
85
        );
86
        $this->add(
87
            array(
88
            'name' => 'email',
89
            'type'  => 'email',
90
            'attributes' => array(
91
            'type'  => 'email',
92
            ),
93
            'options' => array(
94
            'label' => 'admin email',
95
            ),
96
            )
97
        );
98
99
        $this->add(
100
            array(
101
            'name' => 'client_id',
102
            'type'  => 'select',
103
            'attributes' => array(
104
                    'type'  => 'select',
105
                    'options' => array(),
106
            ),
107
            'options' => array(
108
            'label' => 'client',
109
            ),
110
            )
111
        );
112
        
113
        
114
        $this->add(
115
            array(
116
            'name' => 'submit',
117
            'attributes' => array(
118
            'type'  => 'submit',
119
            'value' => 'save',
120
            'id' => 'submitbutton',
121
            ),
122
            'options' => array(
123
            'label' => 'save',
124
            ),
125
            )
126
        );
127
        
128
        $this->add(
129
            array(
130
            'name' => 'reset',
131
            'attributes' => array(
132
            'type'  => 'reset',
133
            'value' => 'reset',
134
            'id' => 'resetbutton',
135
            ),
136
            'options' => array(
137
            'label' => 'reset',
138
            ),
139
            )
140
        );
141
    }
142
}