ReadableStream::resume()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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 24
    public function __construct()
14
    {
15 24
        $this->closed = false;
16 24
    }
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 9
    public function pipe(WritableStreamInterface $dest, array $options = [])
46
    {
47 9
        $this->pipeAll($this, $dest, $options);
48
49 9
        return $dest;
50
    }
51
}
52