Response   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getBody() 0 4 1
A getCode() 0 4 1
A getStatusCode() 0 4 1
A getHeaders() 0 4 1
A getJson() 0 4 1
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