Passed
Branch master (69e5ee)
by Timon
05:22
created

Response   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 83
rs 10
c 0
b 0
f 0
ccs 17
cts 17
cp 1
wmc 6
lcom 0
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getType() 0 4 1
A getData() 0 4 1
A getBacktrace() 0 4 1
A getProfile() 0 4 1
A getNote() 0 4 1
1
<?php
2
3
namespace TBolier\RethinkQL\Response;
4
5
class Response implements ResponseInterface
6
{
7
    /**
8
     * @var int
9
     */
10
    private $type;
11
12
    /**
13
     * @var array
14
     */
15
    private $data;
16
17
    /**
18
     * @var array
19
     */
20
    private $backtrace;
21
22
    /**
23
     * @var array
24
     */
25
    private $profile;
26
27
    /**
28
     * @var array
29
     */
30
    private $note;
31
32
    /**
33
     * @param int $type
0 ignored issues
show
Bug introduced by
There is no parameter named $type. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
34
     * @param array $data
0 ignored issues
show
Bug introduced by
There is no parameter named $data. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
35
     * @param array $backtrace
0 ignored issues
show
Bug introduced by
There is no parameter named $backtrace. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
36
     * @param array|null $profile
0 ignored issues
show
Bug introduced by
There is no parameter named $profile. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     * @param array|null $note
0 ignored issues
show
Bug introduced by
There is no parameter named $note. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
     */
39 16
    public function __construct(int $t = null, array $r = null, array $b = null, array $p = null, array $n = null)
40
    {
41 16
        $this->type = $t;
42 16
        $this->data = $r;
0 ignored issues
show
Documentation Bug introduced by
It seems like $r can be null. However, the property $data is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
43 16
        $this->backtrace = $b;
0 ignored issues
show
Documentation Bug introduced by
It seems like $b can be null. However, the property $backtrace is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
44 16
        $this->profile = $p;
0 ignored issues
show
Documentation Bug introduced by
It seems like $p can be null. However, the property $profile is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
45 16
        $this->note = $n;
0 ignored issues
show
Documentation Bug introduced by
It seems like $n can be null. However, the property $note is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
46 16
    }
47
48
    /**
49
     * @return int
50
     */
51 16
    public function getType(): int
52
    {
53 16
        return $this->type;
54
    }
55
56
    /**
57
     * @return array
58
     */
59 15
    public function getData(): array
60
    {
61 15
        return $this->data;
62
    }
63
64
    /**
65
     * @return array
66
     */
67 1
    public function getBacktrace(): array
68
    {
69 1
        return $this->backtrace;
70
    }
71
72
    /**
73
     * @return array
74
     */
75 1
    public function getProfile(): array
76
    {
77 1
        return $this->profile;
78
    }
79
80
    /**
81
     * @return array
82
     */
83 1
    public function getNote(): array
84
    {
85 1
        return $this->note;
86
    }
87
}
88