Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
37 | 1 | public function scan(Context $context) |
|
38 | { |
||
39 | 1 | $index = $context->getCursor(); |
|
40 | |||
41 | 1 | $string = $context->value(strlen($this->rule)); |
|
42 | |||
43 | 1 | if ($string !== $this->rule) { |
|
44 | 1 | $context->setCursor($index); |
|
45 | 1 | $context->error($this, $index); |
|
46 | |||
47 | 1 | return false; |
|
48 | } |
||
49 | |||
50 | 1 | $result = new Result($this->name); |
|
51 | 1 | $result->setValue($string, $index); |
|
52 | 1 | $this->action($result); |
|
53 | |||
54 | 1 | return $result; |
|
55 | } |
||
56 | } |
||
57 |