Code Duplication    Length = 3-3 lines in 2 locations

src/Protocol/WebSocket/Frame.php 2 locations

@@ 166-168 (lines=3) @@
163
        }
164
165
        if ($length == 126) { // with 2 bytes extended payload length
166
            if (($packedPayloadLength = substr($encodedData, 2, 2)) === false) {
167
                return [0, 0];
168
            }
169
170
            return [unpack("n", $packedPayloadLength)[1] + 2, 2];
171
        }
@@ 174-176 (lines=3) @@
171
        }
172
173
        if ($length == 127) { //with 8 bytes extended payload length
174
            if (($packedPayloadLength = substr($encodedData, 2, 8)) === false) {
175
                return [0, 0];
176
            }
177
            $payloadLength = unpack("N2", $packedPayloadLength);
178
179
            return [($payloadLength[1] << 32) | $payloadLength[2] + 8, 8];