Error   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A getContext() 0 3 1
A getMessage() 0 3 1
A __construct() 0 4 1
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