Code Duplication    Length = 15-17 lines in 2 locations

src/Http/Socket/SocketServer.php 2 locations

@@ 117-133 (lines=17) @@
114
     *
115
     * @param SocketInterface $socket
116
     */
117
    public function handleDisconnect($socket)
118
    {
119
        try
120
        {
121
            $this->component->handleDisconnect($socket->conn);
122
        }
123
        catch (Error $ex)
124
        {
125
            $this->handleError($socket, $ex);
126
        }
127
        catch (Exception $ex)
128
        {
129
            $this->handleError($socket, $ex);
130
        }
131
132
        unset($socket->conn);
133
    }
134
135
    /**
136
     * Handler triggered when a new data is received from existing connection.
@@ 163-177 (lines=15) @@
160
     * @param SocketInterface $socket
161
     * @param Error|Exception $ex
162
     */
163
    public function handleError($socket, $ex)
164
    {
165
        try
166
        {
167
            $this->component->handleError($socket->conn, $ex);
168
        }
169
        catch (Error $ex)
170
        {
171
            $this->close($socket);
172
        }
173
        catch (Exception $ex)
174
        {
175
            $this->close($socket);
176
        }
177
    }
178
179
    /**
180
     * Close socket.