Code Duplication    Length = 5-5 lines in 2 locations

PHPDaemon/Servers/WebSocket/Connection.php 2 locations

@@ 226-230 (lines=5) @@
223
    public function handshake()
224
    {
225
        $this->route = $this->pool->getRoute($this->server['DOCUMENT_URI'], $this);
226
        if (!$this->route) {
227
            Daemon::$process->log(get_class($this) . '::' . __METHOD__ . ' : Cannot handshake session for client "' . $this->addr . '"');
228
            $this->finish();
229
            return false;
230
        }
231
232
        if (method_exists($this->route, 'onBeforeHandshake')) {
233
            $this->route->onWakeup();
@@ 257-261 (lines=5) @@
254
            }
255
        }
256
257
        if (!$this->sendHandshakeReply($extraHeaders)) {
258
            Daemon::$process->log(get_class($this) . '::' . __METHOD__ . ' : Handshake protocol failure for client "' . $this->addr . '"');
259
            $this->finish();
260
            return false;
261
        }
262
263
        $this->handshaked = true;
264
        $this->headers_sent = true;