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

Response   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 4
Metric Value
wmc 3
c 4
b 0
f 4
lcom 0
cbo 0
dl 0
loc 57
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getBody() 0 4 1
A getStatus() 0 4 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