Completed
Pull Request — master (#17)
by
unknown
01:17
created

Error::getMessage()   A

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 declare(strict_types=1);
2
3
namespace h4kuna\Ares;
4
5
class Error
6
{
7
	
8
	/** @var int */
9
	protected $code;
10
	
11
	/** @var string */
12
	protected $message;
13
14
	/**
15
	 * Error constructor.
16
	 * @param int $code
17
	 * @param string $message
18
	 */
19
	public function __construct(int $code, string $message)
20
	{
21
		$this->code = $code;
22
		$this->message = $message;
23
	}
24
25
	/**
26
	 * @return int
27
	 */
28
	public function getCode(): int
29
	{
30
		return $this->code;
31
	}
32
33
	/**
34
	 * @return string
35
	 */
36
	public function getMessage(): string
37
	{
38
		return $this->message;
39
	}
40
41
	public function toArray(): array
42
	{
43
		return [
44
			'code' => $this->code,
45
			'message' => $this->message,
46
		];
47
	}
48
	
49
}
50