Completed
Pull Request — master (#14)
by Johan
03:58 queued 02:02
created

Response   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 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
     * Contents.
16
     *
17
     * @var string
18
     */
19
    protected $body;
20
21
    /**
22
     * Assign dependencies.
23
     *
24
     * @param int    $status
25
     * @param array  $headers
26
     * @param string $body
27
     */
28 12
    public function __construct($status = 200, array $headers = [], $body = null)
0 ignored issues
show
Unused Code introduced by
The parameter $headers is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30 12
        $this->status = $status;
31 12
        $this->body = $body;
32 12
    }
33
34
    /**
35
     * Get body.
36
     *
37
     * @return string
38
     */
39 8
    public function getBody()
40
    {
41 8
        return $this->body;
42
    }
43
44
    /**
45
     * Get HTTP status code.
46
     *
47
     * @return string
48
     */
49 2
    public function getStatus()
50
    {
51 2
        return $this->status;
52
    }
53
}
54