Total Complexity | 8 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 0 |
1 | <?php |
||
8 | class Response extends BaseResponse implements ResponseInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $data; |
||
14 | |||
15 | 37 | public function __construct(string $content = '', int $status = 200, array $headers = array()) |
|
16 | { |
||
17 | 37 | parent::__construct($content, $status, $headers); |
|
18 | |||
19 | 37 | $this->data = $this->jsonToArray($content); |
|
20 | 37 | } |
|
21 | |||
22 | /** |
||
23 | * {@inheritDoc} |
||
24 | */ |
||
25 | 37 | public function getData() |
|
26 | { |
||
27 | 37 | return $this->data; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | 24 | public function setData($data) |
|
36 | 24 | } |
|
37 | |||
38 | 37 | protected function jsonToArray(string $content = null): ?array |
|
56 |