Checkbox::getCheckedValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 2
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