Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
BooleanOption
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
4.12
0.00% covered (danger)
0.00%
0 / 1
 check
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getValueForPrint
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace WebPConvert\Options;
4
5use WebPConvert\Options\Option;
6use 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 */
15class 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}