Response::getBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php namespace Arcanedev\Stripe\Http;
2
3
use Arcanedev\Stripe\Contracts\Http\Response as ResponseContract;
4
5
/**
6
 * Class     Response
7
 *
8
 * @package  Arcanedev\Stripe\Http
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Response implements ResponseContract
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    protected $body;
18
    protected $code;
19
    protected $headers;
20
    protected $json;
21
22
    /* ------------------------------------------------------------------------------------------------
23
     |  Constructor
24
     | ------------------------------------------------------------------------------------------------
25
     */
26
    /**
27
     * Make Response instance.
28
     *
29
     * @param  string      $body
30
     * @param  int         $code
31
     * @param  array|null  $headers
32
     * @param  array|null  $json
33
     */
34 396
    public function __construct($body, $code, $headers, $json)
35
    {
36 396
        $this->body    = $body;
37 396
        $this->code    = $code;
38 396
        $this->headers = $headers;
39 396
        $this->json    = $json;
40 396
    }
41
42
    /* ------------------------------------------------------------------------------------------------
43
     |  Getters & Setters
44
     | ------------------------------------------------------------------------------------------------
45
     */
46
    /**
47
     * Get response body.
48
     *
49
     * @return string
50
     */
51 2
    public function getBody()
52
    {
53 2
        return $this->body;
54
    }
55
56
    /**
57
     * Get response status code.
58
     *
59
     * @return int
60
     */
61 8
    public function getCode()
62
    {
63 8
        return $this->code;
64
    }
65
66
    /**
67
     * Get response status code.
68
     *
69
     * @return int
70
     */
71 6
    public function getStatusCode()
72
    {
73 6
        return $this->getCode();
74
    }
75
76
    /**
77
     * Get response header.
78
     *
79
     * @return array|null
80
     */
81 2
    public function getHeaders()
82
    {
83 2
        return $this->headers;
84
    }
85
86
    /**
87
     * Get response json.
88
     *
89
     * @return array|null
90
     */
91 388
    public function getJson()
92
    {
93 388
        return $this->json;
94
    }
95
}
96