FieldRadio::fill()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace hemio\form;
4
5
class FieldRadio extends FieldCheckbox
6
{
7
8
    public function getInputType()
9
    {
10
        return 'radio';
11
    }
12
13
    public function fill()
14
    {
15
        $fill = parent::fill();
16
17
        $this->control->setAttribute('value', $this->idSuffix);
18
        if ($this->idSuffix === $this->getValueToUse())
19
            $this->control->setAttribute('checked', true);
20
21
        return $fill;
22
    }
23
}
24