Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

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