Conditions | 6 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
36 | 9 | protected function parse(&$input, $offset, Context $context) |
|
37 | { |
||
38 | 9 | $this->pushCaseSensitivityToContext($context); |
|
39 | 9 | $pattern = $this->pattern . ($context->isCaseSensitive() |
|
40 | 8 | ? '' |
|
41 | 9 | : 'i'); |
|
42 | 9 | $this->popCaseSensitivityFromContext($context); |
|
43 | |||
44 | 9 | if (preg_match($pattern, $input, $match, 0, $offset) !== false) { |
|
45 | 9 | if (count($match) > 0 && mb_strlen($match[0]) > 0 && strpos($input, $match[0], $offset) === $offset) { |
|
46 | 6 | return $this->success($input, $offset, mb_strlen($match[0])); |
|
47 | } |
||
48 | } |
||
49 | |||
50 | 3 | return $this->failure($input, $offset); |
|
51 | } |
||
58 |