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

HiddenField::getAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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
}