DeflateStream   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 27
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A writeFilter() 0 3 1
A readFilter() 0 3 1
1
<?php
2
3
namespace Http\Message\Encoding;
4
5
use Clue\StreamFilter as Filter;
6
use Psr\Http\Message\StreamInterface;
7
8
/**
9
 * Stream deflate (RFC 1951).
10
 *
11
 * @author Joel Wurtz <[email protected]>
12
 */
13
class DeflateStream extends FilteredStream
14
{
15
    /**
16
     * @param int $level
17
     */
18
    public function __construct(StreamInterface $stream, $level = -1)
19 5
    {
20
        parent::__construct($stream, ['window' => -15, 'level' => $level]);
21 5
22
        // @deprecated will be removed in 2.0
23
        $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]);
0 ignored issues
show
Bug introduced by
The function fun was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        $this->writeFilterCallback = /** @scrutinizer ignore-call */ Filter\fun($this->writeFilter(), ['window' => -15]);
Loading history...
Deprecated Code introduced by
The property Http\Message\Encoding\Fi...m::$writeFilterCallback has been deprecated: since version 1.5, will be removed in 2.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

23
        /** @scrutinizer ignore-deprecated */ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]);

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
24 5
    }
25 5
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function readFilter()
30 5
    {
31
        return 'zlib.deflate';
32 5
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    protected function writeFilter()
38 5
    {
39
        return 'zlib.inflate';
40 5
    }
41
}
42