Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
15 | 20 | public static function fromOffset(string $buffer, int $offset, int $expectedLength): self |
|
16 | { |
||
17 | 20 | $actualLength = strlen($buffer) - $offset; |
|
18 | |||
19 | 20 | return new self( |
|
20 | 20 | $buffer, |
|
21 | "Not enough data to decode: expected length bytes ${expectedLength}, got ${actualLength}" |
||
22 | ); |
||
23 | } |
||
24 | |||
37 |