Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
25.00% |
2 / 8 |
|
50.00% |
2 / 4 |
CRAP | |
0.00% |
0 / 1 |
SensitiveStringOption | |
25.00% |
2 / 8 |
|
50.00% |
2 / 4 |
15.55 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
check | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getValueForPrint | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
getDefinition | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace WebPConvert\Options; |
4 | |
5 | use WebPConvert\Options\StringOption; |
6 | use WebPConvert\Options\Exceptions\InvalidOptionValueException; |
7 | |
8 | /** |
9 | * Abstract option class |
10 | * |
11 | * @package WebPConvert |
12 | * @author Bjørn Rosell <it@rosell.dk> |
13 | * @since Class available since Release 2.0.0 |
14 | */ |
15 | class SensitiveStringOption extends StringOption |
16 | { |
17 | |
18 | public function __construct($id, $defaultValue, $enum = null) |
19 | { |
20 | parent::__construct($id, $defaultValue, $enum); |
21 | } |
22 | |
23 | public function check() |
24 | { |
25 | parent::check(); |
26 | } |
27 | |
28 | public function getValueForPrint() |
29 | { |
30 | if (strlen($this->getValue()) == 0) { |
31 | return '""'; |
32 | } |
33 | return '*****'; |
34 | } |
35 | |
36 | public function getDefinition() |
37 | { |
38 | $obj = parent::getDefinition(); |
39 | $obj['sensitive'] = true; |
40 | return $obj; |
41 | } |
42 | } |