Passed
Push — master ( 5731b9...6612be )
by Jared
02:33
created

JCResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 33
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2
ccs 9
cts 9
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A status() 0 4 1
A body() 0 4 1
A headers() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: jaredchu
5
 * Date: 31/05/2017
6
 * Time: 09:50
7
 */
8
9
namespace JC;
10
11
12
use Psr\Http\Message\ResponseInterface;
13
14
class JCResponse implements iJCResponse
15
{
16
17
    /**
18
     * @var ResponseInterface
19
     */
20
    public $response;
21
22
    /**
23
     * JCResponse constructor.
24
     * @param $response
25
     */
26 6
    public function __construct($response)
27
    {
28 6
        $this->response = $response;
29 6
    }
30
31
32 6
    public function status()
33
    {
34 6
        return $this->response->getStatusCode();
35
    }
36
37 6
    public function body()
38
    {
39 6
        return $this->response->getBody()->getContents();
40
    }
41
42 1
    public function headers()
43
    {
44 1
        return $this->response->getHeaders();
45
    }
46
}