Completed
Push — master ( a307b3...1e50c9 )
by Rougin
06:44
created

Response   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
namespace Zapheus\Bridge\Psr\Zapheus;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Zapheus\Http\Message\Response as ZapheusResponse;
7
8
/**
9
 * PSR-07 to Zapheus Response Bridge
10
 *
11
 * @package Zapheus
12
 * @author  Rougin Gutib <[email protected]>
13
 */
14
class Response extends ZapheusResponse
15
{
16
    /**
17
     * Initializes the response instance.
18
     *
19
     * @param \Psr\Http\Message\ResponseInterface $response
20
     */
21
    public function __construct(ResponseInterface $response)
22
    {
23
        $this->code = $response->getStatusCode();
24
25
        $this->headers = $response->getHeaders();
26
27
        $this->stream = new Stream($response->getBody());
28
29
        $this->version = $response->getProtocolVersion();
30
    }
31
}
32