Checkbox::setUncheckedValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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