Response::getDocument()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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