Response   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPsrResponse() 0 4 1
A getDocument() 0 4 1
1
<?php
2
/**
3
 * Response.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        https://www.ipublikuj.eu
7
 * @author         Adam Kadlec <[email protected]>
8
 * @package        iPublikuj:JsonAPIClient!
9
 * @subpackage     Http
10
 * @since          1.0.0
11
 *
12
 * @date           05.05.18
13
 */
14
15
declare(strict_types = 1);
16
17
namespace IPub\JsonAPIClient\Http;
18
19
use Psr\Http\Message\ResponseInterface as PsrResponse;
20
21
use IPub\JsonAPIClient\Objects;
22
23
/**
24
 * Client response
25
 *
26
 * @package        iPublikuj:JsonAPIClient!
27
 * @subpackage     Http
28
 *
29
 * @author         Adam Kadlec <[email protected]>
30
 */
31
class Response implements IResponse
32
{
33
	/**
34
	 * @var PsrResponse
35
	 */
36
	private $response;
37
38
	/**
39
	 * @var Objects\IDocument|NULL
40
	 */
41
	private $document;
42
43
	/**
44
	 * @param PsrResponse $response
45
	 * @param Objects\IDocument|NULL $document
46
	 */
47
	public function __construct(PsrResponse $response, ?Objects\IDocument $document = NULL)
48
	{
49
		$this->response = $response;
50
		$this->document = $document;
51
	}
52
53
	/**
54
	 * {@inheritdoc}
55
	 */
56
	public function getPsrResponse() : PsrResponse
57
	{
58
		return $this->response;
59
	}
60
61
	/**
62
	 * {@inheritdoc}
63
	 */
64
	public function getDocument() : Objects\IDocument
65
	{
66
		return $this->document;
67
	}
68
}
69