Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 444-454 (lines=11) @@
441
        return $num;
442
    }
443
444
    private function unpackUint64()
445
    {
446
        if (!isset($this->buffer[$this->offset + 7])) {
447
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
448
        }
449
450
        $num = \unpack('J', $this->buffer, $this->offset)[1];
451
        $this->offset += 8;
452
453
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
454
    }
455
456
    private function unpackInt8()
457
    {
@@ 481-491 (lines=11) @@
478
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
479
    }
480
481
    private function unpackInt32()
482
    {
483
        if (!isset($this->buffer[$this->offset + 3])) {
484
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
485
        }
486
487
        $num = \unpack('N', $this->buffer, $this->offset)[1];
488
        $this->offset += 4;
489
490
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
491
    }
492
493
    private function unpackInt64()
494
    {