Passed
Push — master ( 7b4f81...84e0ca )
by Igor
03:22
created

StreamWrite::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 1
crap 1
1
<?php
2
3
namespace ClickHouseDB\Transport;
4
5
/**
6
 * Class StreamWrite
7
 * @package ClickHouseDB\Transport
8
 */
9
class StreamWrite extends Stream
10
{
11
12 1
    public function __construct( $source)
13
    {
14
15 1
        parent::__construct($source);
16
17 1
    }
18
19 1
    public function isWrite()
20
    {
21 1
        return true;
22
    }
23 1
    public function applyGzip()
24
    {
25 1
        stream_filter_append($this->getStream(), 'zlib.deflate', STREAM_FILTER_READ, ['window' => 30]);
26 1
        $this->enableGzipHeader();
27 1
    }
28
}
29