Response   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 61
rs 10
ccs 14
cts 14
cp 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getData() 0 3 1
A getResponseCode() 0 3 1
A getExtensions() 0 3 1
A getHeaders() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace SlevomatCsobGateway\Api;
4
5
class Response
6
{
7
8
	/** @var ResponseCode */
9
	private $responseCode;
10
11
	/** @var mixed[]|null */
12
	private $data;
13
14
	/** @var string[] */
15
	private $headers;
16
17
	/** @var mixed[] */
18
	private $extensions;
19
20
	/**
21
	 * @param ResponseCode $responseCode
22
	 * @param mixed[]|null $data
23
	 * @param string[] $headers
24
	 * @param mixed[] $extensions
25
	 */
26 32
	public function __construct(
27
		ResponseCode $responseCode,
28
		?array $data,
29
		array $headers = [],
30
		array $extensions = []
31
	)
32
	{
33 32
		$this->responseCode = $responseCode;
34 32
		$this->data = $data;
35 32
		$this->headers = $headers;
36 32
		$this->extensions = $extensions;
37 32
	}
38
39 17
	public function getResponseCode(): ResponseCode
40
	{
41 17
		return $this->responseCode;
42
	}
43
44
	/**
45
	 * @return mixed[]|null
46
	 */
47 31
	public function getData(): ?array
48
	{
49 31
		return $this->data;
50
	}
51
52
	/**
53
	 * @return string[]
54
	 */
55 9
	public function getHeaders(): array
56
	{
57 9
		return $this->headers;
58
	}
59
60
	/**
61
	 * @return mixed[]
62
	 */
63 2
	public function getExtensions(): array
64
	{
65 2
		return $this->extensions;
66
	}
67
68
}
69