Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 18 | public function extractBodyFromLine(string $line): string |
|
41 | { |
||
42 | 18 | if (substr($line, 0, $this->tagLength + 1) === $this->tag . ' ') { |
|
43 | 16 | return substr($line, $this->tagLength + 1); |
|
44 | } |
||
45 | |||
46 | 3 | throw new \InvalidArgumentException( |
|
47 | 3 | sprintf( |
|
48 | 3 | 'Line `%s` does not contain the tag %s', |
|
49 | 3 | $line, |
|
50 | 3 | $this->tag |
|
51 | ) |
||
52 | ); |
||
53 | } |
||
54 | |||
63 | } |