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

DeflateStream   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A readFilter() 0 4 1
A writeFilter() 0 4 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