Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 516-526 (lines=11) @@
513
        return $num;
514
    }
515
516
    private function unpackUint64()
517
    {
518
        if (!isset($this->buffer[$this->offset + 7])) {
519
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
520
        }
521
522
        $num = \unpack('J', $this->buffer, $this->offset)[1];
523
        $this->offset += 8;
524
525
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
526
    }
527
528
    private function unpackInt8()
529
    {
@@ 553-563 (lines=11) @@
550
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
551
    }
552
553
    private function unpackInt32()
554
    {
555
        if (!isset($this->buffer[$this->offset + 3])) {
556
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
557
        }
558
559
        $num = \unpack('N', $this->buffer, $this->offset)[1];
560
        $this->offset += 4;
561
562
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
563
    }
564
565
    private function unpackInt64()
566
    {