Code Duplication    Length = 8-8 lines in 2 locations

src/WebSocket/FrameHandler.php 2 locations

@@ 82-89 (lines=8) @@
79
     * @param Frame $binary
80
     * @throws WebSocketError
81
     */
82
    protected function onBinary (Frame $binary): void {
83
        $this->binary .= $binary->getPayload();
84
        if ($binary->isFinal()) {
85
            $message = $this->binary;
86
            $this->binary = '';
87
            $this->client->getMessageHandler()->onBinary($message);
88
        }
89
    }
90
91
    /**
92
     * When a `CLOSE` frame is received.
@@ 264-271 (lines=8) @@
261
     * @param Frame $text
262
     * @throws WebSocketError
263
     */
264
    protected function onText (Frame $text): void {
265
        $this->text .= $text->getPayload();
266
        if ($text->isFinal()) {
267
            $message = $this->text;
268
            $this->text = '';
269
            $this->client->getMessageHandler()->onText($message);
270
        }
271
    }
272
273
    /**
274
     * @param int $bytes