| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| 1 | <?php |
||
| 53 | 8 | public function match(Line $line): string |
|
| 54 | { |
||
| 55 | 8 | $str = $line->substr($this->startPos - 1, $this->length); |
|
| 56 | |||
| 57 | 8 | if (!$this->isMatch($str)) { |
|
| 58 | 4 | throw new InvalidContentException( |
|
| 59 | sprintf( |
||
| 60 | 4 | "Invalid content '%s' (expecting %s) starting at position %s", |
|
| 61 | $str, |
||
| 62 | 4 | $this->getDescription(), |
|
| 63 | 4 | $this->startPos - 1 |
|
| 64 | ) |
||
| 65 | ); |
||
| 66 | } |
||
| 67 | |||
| 68 | 4 | return $str; |
|
| 69 | } |
||
| 70 | } |
||
| 71 |