Completed
Push — master ( f97e7d...942adb )
by Aurimas
02:25
created

ReadableStream::close()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 2
Metric Value
dl 13
loc 13
ccs 8
cts 8
cp 1
rs 9.4286
cc 2
eloc 8
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Thruster\Component\Stream;
4
5
/**
6
 * Class ReadableStream
7
 *
8
 * @package Thruster\Component\Stream
9
 * @author  Aurimas Niekis <[email protected]>
10
 */
11
class ReadableStream extends BaseStream implements ReadableStreamInterface
12
{
13 21
    public function __construct()
14
    {
15 21
        $this->closed = false;
16 21
    }
17
18
    /**
19
     * {@inheritDoc}
20
     */
21 8
    public function isReadable() : bool
22
    {
23 8
        return !$this->closed;
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29 2
    public function pause() : self
30
    {
31 2
        return $this;
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     */
37 2
    public function resume() : self
38
    {
39 2
        return $this;
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45 6
    public function pipe(WritableStreamInterface $dest, array $options = [])
46
    {
47 6
        $this->pipeAll($this, $dest, $options);
48
49 6
        return $dest;
50
    }
51
}
52