Checkbox   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 7
c 3
b 0
f 1
lcom 0
cbo 1
dl 0
loc 35
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getUncheckedValue() 0 4 2
A getCheckedValue() 0 4 2
A setUncheckedValue() 0 6 1
A setCheckedValue() 0 6 1
A getDefaultSpecs() 0 6 1
1
<?php
2
namespace Sirius\Input\Element\Input;
3
4
use Sirius\Input\Element\Input as BaseInput;
5
use Sirius\Input\Specs;
6
7
class Checkbox extends BaseInput
8
{
9
10 2
    protected function getDefaultSpecs()
11
    {
12
        return array(
13 2
            Specs::WIDGET => 'checkbox'
14 2
        );
15
    }
16
17 1
    public function setUncheckedValue($val = null)
18
    {
19 1
        $this[Specs::UNCHECKED_VALUE] = (string) $val;
20
21 1
        return $this;
22
    }
23
24 1
    public function getUncheckedValue()
25
    {
26 1
        return isset($this[Specs::UNCHECKED_VALUE]) ? $this[Specs::UNCHECKED_VALUE] : null;
27
    }
28
29 1
    public function setCheckedValue($val = null)
30
    {
31 1
        $this[Specs::CHECKED_VALUE] = (string) $val;
32
33 1
        return $this;
34
    }
35
36 1
    public function getCheckedValue()
37
    {
38 1
        return isset($this[Specs::CHECKED_VALUE]) ? $this[Specs::CHECKED_VALUE] : null;
39
    }
40
41
}
42