Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 503-513 (lines=11) @@
500
        return $num;
501
    }
502
503
    private function unpackUint64()
504
    {
505
        if (!isset($this->buffer[$this->offset + 7])) {
506
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
507
        }
508
509
        $num = \unpack('J', $this->buffer, $this->offset)[1];
510
        $this->offset += 8;
511
512
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
513
    }
514
515
    private function unpackInt8()
516
    {
@@ 540-550 (lines=11) @@
537
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
538
    }
539
540
    private function unpackInt32()
541
    {
542
        if (!isset($this->buffer[$this->offset + 3])) {
543
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
544
        }
545
546
        $num = \unpack('N', $this->buffer, $this->offset)[1];
547
        $this->offset += 4;
548
549
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
550
    }
551
552
    private function unpackInt64()
553
    {