Response   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 58
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A info() 0 4 1
A getBody() 0 4 1
A __toString() 0 4 1
1
<?php namespace CodeZero\Curl;
2
3
class Response
4
{
5
    /**
6
     * The Response Body
7
     *
8
     * @var mixed
9
     */
10
    private $rawResponse;
11
12
    /**
13
     * Additional Response Information
14
     *
15
     * @var ResponseInfo
16
     */
17
    private $responseInfo;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param $rawResponse
23
     * @param ResponseInfo $responseInfo
24
     */
25
    public function __construct($rawResponse, ResponseInfo $responseInfo)
26
    {
27
        $this->rawResponse = $rawResponse;
28
        $this->responseInfo = $responseInfo;
29
    }
30
31
    /**
32
     * Response information
33
     *
34
     * @return ResponseInfo
35
     */
36
    public function info()
37
    {
38
        return $this->responseInfo;
39
    }
40
41
    /**
42
     * Get the response body
43
     *
44
     * @return string
45
     */
46
    public function getBody()
47
    {
48
        return $this->rawResponse;
49
    }
50
51
    /**
52
     * Output the raw response
53
     *
54
     * @return string
55
     */
56
    public function __toString()
57
    {
58
        return $this->rawResponse;
59
    }
60
}
61