Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 457-467 (lines=11) @@
454
        return $num;
455
    }
456
457
    private function unpackUint64()
458
    {
459
        if (!isset($this->buffer[$this->offset + 7])) {
460
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
461
        }
462
463
        $num = \unpack('J', $this->buffer, $this->offset)[1];
464
        $this->offset += 8;
465
466
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
467
    }
468
469
    private function unpackInt8()
470
    {
@@ 494-504 (lines=11) @@
491
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
492
    }
493
494
    private function unpackInt32()
495
    {
496
        if (!isset($this->buffer[$this->offset + 3])) {
497
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
498
        }
499
500
        $num = \unpack('N', $this->buffer, $this->offset)[1];
501
        $this->offset += 4;
502
503
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
504
    }
505
506
    private function unpackInt64()
507
    {