Completed
Push — master ( fb9cc0...a12844 )
by Johan
02:05
created

Response::getStatus()   A

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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Artstorm\MonkeyLearn\HttpClient;
4
5
class Response
6
{
7
    /**
8
     * HTTP Status code
9
     *
10
     * @int
11
     */
12
    protected $status;
13
14
    /**
15
     * Headers.
16
     *
17
     * @var array
18
     */
19
    protected $headers;
20
21
    /**
22
     * Contents.
23
     *
24
     * @var string
25
     */
26
    protected $body;
27
28
    /**
29
     * Assign dependencies.
30
     *
31
     * @param int    $status
32
     * @param array  $headers
33
     * @param string $body
34
     */
35 12
    public function __construct($status = 200, array $headers = [], $body = null)
36
    {
37 12
        $this->status = $status;
38 12
        $this->headers = $headers;
39 12
        $this->body = $body;
40 12
    }
41
42
    /**
43
     * Get body.
44
     *
45
     * @return string
46
     */
47 8
    public function getBody()
48
    {
49 8
        return $this->body;
50
    }
51
52
    /**
53
     * Get HTTP status code.
54
     *
55
     * @return string
56
     */
57 2
    public function getStatus()
58
    {
59 2
        return $this->status;
60
    }
61
}
62