Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 450-460 (lines=11) @@
447
        return $num;
448
    }
449
450
    private function unpackUint64()
451
    {
452
        if (!isset($this->buffer[$this->offset + 7])) {
453
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
454
        }
455
456
        $num = \unpack('J', $this->buffer, $this->offset)[1];
457
        $this->offset += 8;
458
459
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
460
    }
461
462
    private function unpackInt8()
463
    {
@@ 487-497 (lines=11) @@
484
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
485
    }
486
487
    private function unpackInt32()
488
    {
489
        if (!isset($this->buffer[$this->offset + 3])) {
490
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
491
        }
492
493
        $num = \unpack('N', $this->buffer, $this->offset)[1];
494
        $this->offset += 4;
495
496
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
497
    }
498
499
    private function unpackInt64()
500
    {