Code Duplication    Length = 13-13 lines in 2 locations

src/InfoProvider.php 2 locations

@@ 169-181 (lines=13) @@
166
            GlobalState::incr('streams.read.ticks');
167
            GlobalState::incr('streams.total.ticks');
168
        });
169
        $loop->on('removeReadStream', function ($stream) {
170
            $key = (int) $stream;
171
172
            if (isset($this->streamsRead[$key])) {
173
                unset($this->streamsRead[$key]);
174
            }
175
            if (isset($this->streamsDuplex[$key]) && !isset($this->streamsWrite[$key])) {
176
                unset($this->streamsDuplex[$key]);
177
            }
178
179
            GlobalState::set('streams.read.current', count($this->streamsRead));
180
            GlobalState::set('streams.total.current', count($this->streamsDuplex));
181
        });
182
183
        $loop->on('addWriteStream', function ($stream) {
184
            $key = (int) $stream;
@@ 201-213 (lines=13) @@
198
            GlobalState::incr('streams.write.ticks');
199
            GlobalState::incr('streams.total.ticks');
200
        });
201
        $loop->on('removeWriteStream', function ($stream) {
202
            $key = (int) $stream;
203
204
            if (isset($this->streamsWrite[$key])) {
205
                unset($this->streamsWrite[$key]);
206
            }
207
            if (isset($this->streamsDuplex[$key]) && !isset($this->streamsRead[$key])) {
208
                unset($this->streamsDuplex[$key]);
209
            }
210
211
            GlobalState::set('streams.write.current', count($this->streamsWrite));
212
            GlobalState::set('streams.total.current', count($this->streamsDuplex));
213
        });
214
215
        $loop->on('removeStream', function ($stream) {
216
            $key = (int) $stream;