Response::getBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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