Code Duplication    Length = 3-9 lines in 2 locations

PHPDaemon/Network/IOStream.php 2 locations

@@ 306-308 (lines=3) @@
303
                        $flags
304
                    );
305
306
                    if ($this->bev) {
307
                        $this->bev->setCallbacks([$this, 'onReadEv'], [$this, 'onWriteEv'], [$this, 'onStateEv']);
308
                    }
309
                    $this->ssl = true;
310
                } else {
311
                    $this->log('unsupported type of context: ' . ($this->ctx ? get_class($this->ctx) : 'undefined'));
@@ 314-322 (lines=9) @@
311
                    $this->log('unsupported type of context: ' . ($this->ctx ? get_class($this->ctx) : 'undefined'));
312
                    return;
313
                }
314
            } else {
315
                $this->bev = $this->eventLoop->bufferEvent(
316
                    $this->fd,
317
                    $flags,
318
                    [$this, 'onReadEv'],
319
                    [$this, 'onWriteEv'],
320
                    [$this, 'onStateEv']
321
                );
322
            }
323
            if (!$this->bev) {
324
                return;
325
            }