1 | <?php |
||
18 | class Defaults extends FilterRule |
||
19 | { |
||
20 | /** |
||
21 | * Allows a default value to be set if no data key was provided |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $allowNotSet = true; |
||
26 | |||
27 | /** |
||
28 | * @var mixed |
||
29 | */ |
||
30 | protected $defaultValue; |
||
31 | |||
32 | /** |
||
33 | * @param mixed $defaultValue |
||
34 | */ |
||
35 | 13 | public function __construct($defaultValue) |
|
39 | |||
40 | /** |
||
41 | * Return a default value if no value was provided |
||
42 | * |
||
43 | * @param mixed $value |
||
44 | * @return string |
||
45 | */ |
||
46 | 13 | public function filter($value) |
|
50 | } |
||
51 |