Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
BooleanOption | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
4.12 | |
0.00% |
0 / 1 |
check | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getValueForPrint | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace WebPConvert\Options; |
4 | |
5 | use WebPConvert\Options\Option; |
6 | use WebPConvert\Options\Exceptions\InvalidOptionValueException; |
7 | |
8 | /** |
9 | * Boolean option |
10 | * |
11 | * @package WebPConvert |
12 | * @author Bjørn Rosell <it@rosell.dk> |
13 | * @since Class available since Release 2.0.0 |
14 | */ |
15 | class BooleanOption extends Option |
16 | { |
17 | |
18 | protected $typeId = 'boolean'; |
19 | protected $schemaType = ['boolean']; |
20 | |
21 | public function check() |
22 | { |
23 | $this->checkType('boolean'); |
24 | } |
25 | |
26 | public function getValueForPrint() |
27 | { |
28 | return ($this->getValue() === true ? 'true' : 'false'); |
29 | } |
30 | } |