FieldRadio   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInputType() 0 4 1
A fill() 0 10 2
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