Code Duplication    Length = 11-11 lines in 3 locations

src/BufferUnpacker.php 3 locations

@@ 692-702 (lines=11) @@
689
        return $num > 0x7fffffff ? $num - 0x100000000 : $num;
690
    }
691
692
    private static function unpackInt64($buffer, &$offset)
693
    {
694
        if (!isset($buffer[$offset + 7])) {
695
            throw new InsufficientDataException();
696
        }
697
698
        $num = \unpack('J', $buffer, $offset)[1];
699
        $offset += 8;
700
701
        return $num;
702
    }
703
704
    private static function unpackFloat32($buffer, &$offset)
705
    {
@@ 704-714 (lines=11) @@
701
        return $num;
702
    }
703
704
    private static function unpackFloat32($buffer, &$offset)
705
    {
706
        if (!isset($buffer[$offset + 3])) {
707
            throw new InsufficientDataException();
708
        }
709
710
        $num = \unpack('G', $buffer, $offset)[1];
711
        $offset += 4;
712
713
        return $num;
714
    }
715
716
    private static function unpackFloat64($buffer, &$offset)
717
    {
@@ 716-726 (lines=11) @@
713
        return $num;
714
    }
715
716
    private static function unpackFloat64($buffer, &$offset)
717
    {
718
        if (!isset($buffer[$offset + 7])) {
719
            throw new InsufficientDataException();
720
        }
721
722
        $num = \unpack('E', $buffer, $offset)[1];
723
        $offset += 8;
724
725
        return $num;
726
    }
727
728
    private function unpackExtData($length)
729
    {