Code Duplication    Length = 3-3 lines in 2 locations

src/Components/Connection.php 1 location

@@ 124-126 (lines=3) @@
121
        $frame = implode('', $frameHead);
122
123
        // append payload to frame:
124
        for ($i = 0; $i < $payloadLength; $i++) {
125
            $frame .= ($masked === true) ? $payload[$i] ^ $mask[$i % 4] : $payload[$i];
126
        }
127
128
        return $frame;
129
    }

src/Components/WscMain.php 1 location

@@ 337-339 (lines=3) @@
334
        }
335
336
        // Append payload to frame:
337
        for ($i = 0; $i < $payloadLen; $i++) {
338
            $frame .= ($masked === true) ? $payload[$i] ^ $mask[$i % 4] : $payload[$i];
339
        }
340
341
        $this->write($frame);
342
    }