Completed
Push — master ( c6e3b5...fd2349 )
by Milan
15:04 queued 10s
created

Error   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 48
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getCode() 0 4 1
A getMessage() 0 4 1
A getIn() 0 4 1
A toArray() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace h4kuna\Ares;
4
5
final class Error
6
{
7
	/** @var string */
8
	private $in;
9
10
	/** @var int */
11
	private $code;
12
13
	/** @var string */
14
	private $message;
15
16
17
	public function __construct(string $in, int $code, string $message)
18
	{
19
		$this->in = $in;
20
		$this->code = $code;
21
		$this->message = $message;
22
	}
23
24
25
	public function getCode(): int
26
	{
27
		return $this->code;
28
	}
29
30
31
	public function getMessage(): string
32
	{
33
		return $this->message;
34
	}
35
36
37
	public function getIn(): string
38
	{
39
		return $this->in;
40
	}
41
42
43
	public function toArray(): array
44
	{
45
		return [
46
			'in' => $this->in,
47
			'code' => $this->code,
48
			'message' => $this->message,
49
		];
50
	}
51
52
}
53