StreamWrite   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isWrite() 0 3 1
A __construct() 0 4 1
A applyGzip() 0 4 1
1
<?php
0 ignored issues
show
introduced by
Missing declare(strict_types=1).
Loading history...
2
3
namespace ClickHouseDB\Transport;
4
5
/**
6
 * Class StreamWrite
0 ignored issues
show
introduced by
Documentation comment contains forbidden comment "Class StreamWrite".
Loading history...
7
 * @package ClickHouseDB\Transport
0 ignored issues
show
introduced by
Expected 1 lines between description and annotations, found 0.
Loading history...
introduced by
Use of annotation @package is forbidden.
Loading history...
8
 */
9
class StreamWrite extends Stream
10
{
0 ignored issues
show
introduced by
There must be exactly 0 empty lines after class opening brace.
Loading history...
Coding Style introduced by
Opening brace must not be followed by a blank line
Loading history...
11
12 1
    public function __construct( $source)
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening parenthesis; 1 found
Loading history...
introduced by
Method \ClickHouseDB\Transport\StreamWrite::__construct() does not have parameter type hint nor @param annotation for its parameter $source.
Loading history...
Coding Style introduced by
Expected 0 blank lines before function; 1 found
Loading history...
13
    {
0 ignored issues
show
Coding Style introduced by
Expected 0 blank lines after opening function brace; 1 found
Loading history...
14
15 1
        parent::__construct($source);
16
17 1
    }
0 ignored issues
show
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
18
19 1
    public function isWrite()
0 ignored issues
show
introduced by
Method \ClickHouseDB\Transport\StreamWrite::isWrite() does not have return type hint nor @return annotation for its return value.
Loading history...
20
    {
21 1
        return true;
22
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
23 1
    public function applyGzip()
0 ignored issues
show
introduced by
Method \ClickHouseDB\Transport\StreamWrite::applyGzip() does not have void return type hint.
Loading history...
24
    {
25 1
        stream_filter_append($this->getStream(), 'zlib.deflate', STREAM_FILTER_READ, ['window' => 30]);
0 ignored issues
show
introduced by
Function stream_filter_append() should not be referenced via a fallback global name, but via a use statement.
Loading history...
introduced by
Constant STREAM_FILTER_READ should not be referenced via a fallback global name, but via a use statement.
Loading history...
26 1
        $this->enableGzipHeader();
27 1
    }
28
}
29