| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 32 | public static function unexpectedLength(string $buffer, int $offset, int $expectedLength) : self |
|
| 17 | { |
||
| 18 | 32 | $actualLength = \strlen($buffer) - $offset; |
|
| 19 | 32 | $message = "Not enough data to unpack: expected $expectedLength, got $actualLength."; |
|
| 20 | |||
| 21 | 32 | return new self($message); |
|
| 22 | } |
||
| 23 | } |
||
| 24 |