Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

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