Hidden   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A inputAttributes() 0 6 1
1
<?php
2
namespace Rocket\UI\Forms\Fields;
3
4
/**
5
 * Manage hidden fields
6
 */
7
8
/**
9
 * Hidden field
10
 *
11
 * @author Stéphane Goetz
12
 */
13
class Hidden extends Field
14
{
15
    /**
16
     * Extends the type
17
     * @param string $id
18
     * @param array $data
19
     */
20
    public function __construct($id, $data = [])
21
    {
22
        $this->type = 'hidden';
23
        $this->show_label = false;
24
25
        parent::__construct($id, $data);
26
    }
27
28
    /**
29
     * Override the attributes to stay hidden
30
     */
31
    protected function inputAttributes()
32
    {
33
        $this->input_attributes['name'] = $this->name;
34
        $this->input_attributes['id'] = $this->id;
35
        $this->input_attributes['type'] = 'hidden';
36
    }
37
}
38