ThrowableContextTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getContext() 0 3 1
1
<?php
2
/**
3
 * {@see https://github.com/zee/ Zee Project (c)}
4
 */
5
6
declare(strict_types=1);
7
8
namespace Zee\Exceptions;
9
10
trait ThrowableContextTrait
11
{
12
    private $context = [];
13
14 13
    public function __construct(string $message = '', array $context = [], int $code = 0, \Throwable $previous = null)
15
    {
16 13
        parent::__construct($message, $code, $previous);
17
18 13
        $this->context = $context;
19
    }
20
21 13
    public function getContext(): array
22
    {
23 13
        return $this->context;
24
    }
25
}
26