Code Duplication    Length = 11-11 lines in 2 locations

src/BufferUnpacker.php 2 locations

@@ 463-473 (lines=11) @@
460
        return $num;
461
    }
462
463
    private function unpackUint64()
464
    {
465
        if (!isset($this->buffer[$this->offset + 7])) {
466
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 8);
467
        }
468
469
        $num = \unpack('J', $this->buffer, $this->offset)[1];
470
        $this->offset += 8;
471
472
        return $num < 0 ? $this->handleIntOverflow($num) : $num;
473
    }
474
475
    private function unpackInt8()
476
    {
@@ 500-510 (lines=11) @@
497
        return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
498
    }
499
500
    private function unpackInt32()
501
    {
502
        if (!isset($this->buffer[$this->offset + 3])) {
503
            throw InsufficientDataException::unexpectedLength($this->buffer, $this->offset, 4);
504
        }
505
506
        $num = \unpack('N', $this->buffer, $this->offset)[1];
507
        $this->offset += 4;
508
509
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
510
    }
511
512
    private function unpackInt64()
513
    {