QueryException   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
ccs 8
cts 14
cp 0.5714
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequestDetails() 0 3 1
A getResponseDetails() 0 3 1
A cannotInsertEmptyValues() 0 3 1
A noResponse() 0 3 1
A setRequestDetails() 0 3 1
A setResponseDetails() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ClickHouseDB\Exception;
6
7
use LogicException;
8
9
class QueryException extends LogicException implements ClickHouseException
0 ignored issues
show
introduced by
Superfluous suffix "Exception".
Loading history...
10
{
11
    protected $requestDetails = [];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
introduced by
Property \ClickHouseDB\Exception\QueryException::$requestDetails does not have @var annotation for its value.
Loading history...
12
    protected $responseDetails = [];
0 ignored issues
show
introduced by
Property \ClickHouseDB\Exception\QueryException::$responseDetails does not have @var annotation for its value.
Loading history...
13
14 1
    public static function cannotInsertEmptyValues() : self
0 ignored issues
show
introduced by
There must be no whitespace between closing parenthesis and return type colon.
Loading history...
15
    {
16 1
        return new self('Inserting empty values array is not supported in ClickHouse');
17
    }
18
19
    public static function noResponse() : self
0 ignored issues
show
introduced by
There must be no whitespace between closing parenthesis and return type colon.
Loading history...
20
    {
21
        return new self('No response returned');
22
    }
23
24 1
    public function setRequestDetails(array $requestDetails)
0 ignored issues
show
introduced by
Method \ClickHouseDB\Exception\QueryException::setRequestDetails() does not have @param annotation for its traversable parameter $requestDetails.
Loading history...
introduced by
Method \ClickHouseDB\Exception\QueryException::setRequestDetails() does not have void return type hint.
Loading history...
25
    {
26 1
        $this->requestDetails = $requestDetails;
27 1
    }
28
29
    public function getRequestDetails(): array
0 ignored issues
show
introduced by
Method \ClickHouseDB\Exception\QueryException::getRequestDetails() does not have @return annotation for its traversable return value.
Loading history...
30
    {
31
        return $this->requestDetails;
32
    }
33
34 1
    public function setResponseDetails(array $responseDetails)
0 ignored issues
show
introduced by
Method \ClickHouseDB\Exception\QueryException::setResponseDetails() does not have @param annotation for its traversable parameter $responseDetails.
Loading history...
introduced by
Method \ClickHouseDB\Exception\QueryException::setResponseDetails() does not have void return type hint.
Loading history...
35
    {
36 1
        $this->responseDetails = $responseDetails;
37 1
    }
38
39
    public function getResponseDetails(): array
0 ignored issues
show
introduced by
Method \ClickHouseDB\Exception\QueryException::getResponseDetails() does not have @return annotation for its traversable return value.
Loading history...
40
    {
41
        return $this->responseDetails;
42
    }
43
}
44