1 | <?php |
||
16 | class NumberValueParser implements ValueParserInterface |
||
17 | { |
||
18 | /** |
||
19 | * @param string $string |
||
20 | * |
||
21 | * @return mixed |
||
22 | */ |
||
23 | 8 | public function parseValue($string) |
|
24 | { |
||
25 | 8 | return (double) filter_var( |
|
26 | $string, |
||
27 | 8 | FILTER_SANITIZE_NUMBER_FLOAT, |
|
28 | 8 | FILTER_FLAG_ALLOW_FRACTION | FILTER_FLAG_ALLOW_SCIENTIFIC |
|
29 | ); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $string |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | 13 | public function canParseValue($string) |
|
41 | } |
||
42 |