Code Duplication    Length = 5-5 lines in 2 locations

src/Stream/Stream.php 1 location

@@ 148-152 (lines=5) @@
145
                $this->loop->addReadStream($this->resource, $this->getHandleReadFunction());
146
            }
147
148
            if ($this->writable && $this->buffer->isEmpty() === false)
149
            {
150
                $this->writing = true;
151
                $this->loop->addWriteStream($this->resource, $this->getHandleWriteFunction());
152
            }
153
        }
154
    }
155

src/Stream/StreamWriter.php 1 location

@@ 119-123 (lines=5) @@
116
        if ($this->writable && $this->paused)
117
        {
118
            $this->paused = false;
119
            if ($this->buffer->isEmpty() === false)
120
            {
121
                $this->writing = true;
122
                $this->loop->addWriteStream($this->resource, $this->getHandleWriteFunction());
123
            }
124
        }
125
    }
126