1 | <?php |
||
16 | class CallbackValueParser implements ValueParserInterface |
||
17 | { |
||
18 | /** @var callable */ |
||
19 | private $canParse; |
||
20 | /** @var callable */ |
||
21 | private $parse; |
||
22 | |||
23 | /** |
||
24 | * CallbackValueParser constructor. |
||
25 | * |
||
26 | * @param callable $canParse |
||
27 | * @param callable $parse |
||
28 | */ |
||
29 | 2 | public function __construct(callable $canParse, callable $parse) |
|
34 | |||
35 | /** |
||
36 | * @param string $string |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | 1 | public function parseValue($string) |
|
44 | |||
45 | /** |
||
46 | * @param string $string |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | 1 | public function canParseValue($string) |
|
54 | } |
||
55 |