Code Duplication    Length = 16-16 lines in 2 locations

src/Stream/StreamReader.php 1 location

@@ 37-52 (lines=16) @@
34
     * @param bool $autoClose
35
     * @throws InvalidArgumentException
36
     */
37
    public function __construct($resource, LoopInterface $loop, $autoClose = true)
38
    {
39
        parent::__construct($resource, $autoClose);
40
41
        if (function_exists('stream_set_read_buffer'))
42
        {
43
            stream_set_read_buffer($this->resource, 0);
44
        }
45
46
        $this->loop = $loop;
47
        $this->reading = false;
48
        $this->readingStarted = false;
49
        $this->paused = true;
50
51
        $this->resume();
52
    }
53
54
    /**
55
     *

src/Stream/StreamWriter.php 1 location

@@ 39-54 (lines=16) @@
36
     * @param bool $autoClose
37
     * @throws InvalidArgumentException
38
     */
39
    public function __construct($resource, LoopInterface $loop, $autoClose = true)
40
    {
41
        parent::__construct($resource, $autoClose);
42
43
        if (function_exists('stream_set_write_buffer'))
44
        {
45
            stream_set_write_buffer($this->resource, 0);
46
        }
47
48
        $this->loop = $loop;
49
        $this->writing = false;
50
        $this->paused = true;
51
        $this->buffer = new Buffer();
52
53
        $this->resume();
54
    }
55
56
    /**
57
     *