Code Duplication    Length = 8-8 lines in 2 locations

src/WebSocket/FrameHandler.php 2 locations

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