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

JCResponse::headers()   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 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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
}