Error::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * {@see https://github.com/zee/ Zee Project (c)}
4
 */
5
6
declare(strict_types=1);
7
8
namespace Zee\Errors;
9
10
final class Error
11
{
12
    private $message;
13
14
    private $context;
15
16 2
    public function __construct(string $message, array $context = [])
17
    {
18 2
        $this->message = $message;
19 2
        $this->context = $context;
20
    }
21
22 1
    public function __toString(): string
23
    {
24 1
        return $this->getMessage();
25
    }
26
27 3
    public function getMessage(): string
28
    {
29 3
        return $this->message;
30
    }
31
32 1
    public function getContext(): array
33
    {
34 1
        return $this->context;
35
    }
36
}
37