Conditions | 4 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
43 | 1 | public function scan(Context $context) |
|
44 | { |
||
45 | 1 | $index = $context->getCursor(); |
|
46 | 1 | $string = $context->value(); |
|
47 | |||
48 | 1 | if (is_string($string) && ($string >= $this->left && $string <= $this->right)) { |
|
49 | 1 | $result = new Result($this->name); |
|
50 | 1 | $result->setValue($string, $index); |
|
51 | 1 | $this->action($result); |
|
52 | |||
53 | 1 | return $result; |
|
54 | } |
||
55 | |||
56 | 1 | $context->setCursor($index); |
|
57 | 1 | $context->error($this, $index); |
|
58 | 1 | return false; |
|
59 | } |
||
60 | } |
||
61 |