Completed
Push — master ( 20ffbd...1761cb )
by Joel
10s
created

DeflateStream::writeFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Http\Message\Encoding;
4
5
use Psr\Http\Message\StreamInterface;
6
7
/**
8
 * Stream deflate (RFC 1951).
9
 *
10
 * @author Joel Wurtz <[email protected]>
11
 */
12
class DeflateStream extends FilteredStream
13
{
14
    /**
15
     * @param StreamInterface $stream
16
     * @param int             $level
17
     */
18 4
    public function __construct(StreamInterface $stream, $level = -1)
19
    {
20 4
        parent::__construct($stream, ['window' => -15, 'level' => $level], ['window' => -15]);
21 4
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 4
    protected function readFilter()
27
    {
28 4
        return 'zlib.deflate';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 4
    protected function writeFilter()
35
    {
36 4
        return 'zlib.inflate';
37
    }
38
}
39