Total Complexity | 4 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | class Not extends Parser |
||
16 | { |
||
17 | use ArgumentsTrait; |
||
18 | |||
19 | private $parser; |
||
20 | |||
21 | 1 | public function __construct($parser) |
|
24 | 1 | } |
|
25 | |||
26 | 6 | protected function parse(&$input, $offset, Context $context) |
|
27 | { |
||
28 | 6 | $match = $this->parser->parse($input, $offset, $context); |
|
29 | |||
30 | 6 | return ($match instanceof Success) |
|
31 | 2 | ? $this->failure($input, $offset, $match->length) |
|
32 | 6 | : $this->success($input, $offset); |
|
33 | } |
||
34 | |||
35 | 6 | public function __toString() |
|
38 | } |
||
39 | } |
||
40 |