Code Duplication    Length = 8-12 lines in 3 locations

src/Websocket/Application.php 3 locations

@@ 149-156 (lines=8) @@
146
    /**
147
     * {@InheritDoc}
148
     */
149
    public function onSubscribe(ConnectionInterface $conn, $topic)
150
    {
151
        $this->dispatch(ConnectionEvent::ON_SUBSCRIBE, new WampEvent($conn, $topic));
152
153
        $this->logger->info('Topic event', ['event' => 'subscribe', 'topic' => $topic]);
154
155
        $this->getTopic($topic)->onSubscribe($conn, $topic);
156
    }
157
158
    /**
159
     * {@InheritDoc}
@@ 173-180 (lines=8) @@
170
    /**
171
     * {@InheritDoc}
172
     */
173
    public function onUnSubscribe(ConnectionInterface $conn, $topic)
174
    {
175
        $this->dispatch(ConnectionEvent::ON_UNSUBSCRIBE, new WampEvent($conn, $topic));
176
177
        $this->logger->info('Topic event', ['event' => 'unsubscribe', 'topic' => $topic]);
178
179
        $this->getTopic($topic)->onUnSubscribe($conn, $topic);
180
    }
181
182
    /**
183
     * {@InheritDoc}
@@ 185-196 (lines=12) @@
182
    /**
183
     * {@InheritDoc}
184
     */
185
    public function onClose(ConnectionInterface $conn)
186
    {
187
        $this->dispatch(ConnectionEvent::ON_CLOSE, new ConnectionEvent($conn));
188
189
        $this->logger->info('Connection event', ['event' => 'close']);
190
191
        foreach ($this->topics as $topic) {
192
            if ($topic->has($conn)) {
193
                $topic->onUnSubscribe($conn, $topic);
194
            }
195
        }
196
    }
197
198
    /**
199
     * {@InheritDoc}