ThrowableContextTrait::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 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