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 compress (RFC 1950). |
||||
10 | * |
||||
11 | * @author Joel Wurtz <[email protected]> |
||||
12 | */ |
||||
13 | class CompressStream extends FilteredStream |
||||
14 | { |
||||
15 | /** |
||||
16 | * @param int $level |
||||
17 | */ |
||||
18 | public function __construct(StreamInterface $stream, $level = -1) |
||||
19 | 6 | { |
|||
20 | if (!extension_loaded('zlib')) { |
||||
21 | 6 | throw new \RuntimeException('The zlib extension must be enabled to use this stream'); |
|||
22 | 1 | } |
|||
23 | |||||
24 | parent::__construct($stream, ['window' => 15, 'level' => $level]); |
||||
25 | 5 | ||||
26 | // @deprecated will be removed in 2.0 |
||||
27 | $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15]); |
||||
0 ignored issues
–
show
Bug
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
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. ![]() |
|||||
28 | 5 | } |
|||
29 | 5 | ||||
30 | /** |
||||
31 | * {@inheritdoc} |
||||
32 | */ |
||||
33 | protected function readFilter() |
||||
34 | 5 | { |
|||
35 | return 'zlib.deflate'; |
||||
36 | 5 | } |
|||
37 | |||||
38 | /** |
||||
39 | * {@inheritdoc} |
||||
40 | */ |
||||
41 | protected function writeFilter() |
||||
42 | 5 | { |
|||
43 | return 'zlib.inflate'; |
||||
44 | 5 | } |
|||
45 | } |
||||
46 |