Response::status()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PSolr\Response;
4
5
class Response extends \ArrayObject
6
{
7
    /**
8
     * @var array
9
     */
10
    protected $params;
11
12
    /**
13
     * @param array $data
14
     * @param array $params
15
     */
16
    public function __construct($data, array $params)
17
    {
18
        $this->params = $params;
19
        $this->normalizeResponse($data);
20
        parent::__construct($data);
21
    }
22
23
    /**
24
     * @param array &$data
25
     */
26
    public function normalizeResponse(&$data) {}
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
28
    /**
29
     * @return array
30
     */
31
    public function getParams()
32
    {
33
        return $this->params();
0 ignored issues
show
Bug introduced by
The method params() does not exist on PSolr\Response\Response. Did you maybe mean getParams()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
34
    }
35
36
    /**
37
     * @return int
38
     */
39
    public function QTime()
40
    {
41
        return $this['responseHeader']['QTime'];
42
    }
43
44
    /**
45
     * @return int
46
     */
47
    public function status()
48
    {
49
        return $this['responseHeader']['status'];
50
    }
51
}
52