Completed
Push — master ( 3d9d62...1c972b )
by JM
02:17
created

HiddenField   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isVisible() 0 4 1
A renderWhenHidden() 0 4 1
A getAttributes() 0 6 1
A getHTML() 0 4 1
1
<?php
2
3
namespace fieldwork\components;
4
5
class HiddenField extends Field
6
{
7
8
    public function isVisible ()
9
    {
10
        return false;
11
    }
12
13
    public function renderWhenHidden ()
14
    {
15
        return self::RM_DEFAULT;
16
    }
17
18
    public function getAttributes ()
19
    {
20
        return array_merge(parent::getAttributes(), [
21
            "type" => "hidden"
22
        ]);
23
    }
24
25
    public function getHTML ($showLabel = true)
26
    {
27
        return "<input " . $this->getAttributesString() . ">";
28
    }
29
}