Passed
Push — master ( bb83e8...945e52 )
by Daniel
12:32
created

InternalException::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\JsonSchemaApi\Exception;
6
7
use Exception;
8
use Throwable;
9
10
abstract class InternalException extends Exception
11
{
12
    /**
13
     * @param Throwable|null $previous
14
     * @param array<mixed, mixed> $context
15
     */
16 12
    public function __construct(
17
        string $message,
18
        int $code,
19
        Throwable $previous = null,
20
        private readonly array $context = []
21
    ) {
22 12
        parent::__construct($message, $code, $previous);
23
    }
24
25
    /**
26
     * @return array<mixed, mixed>
27
     */
28 2
    public function getContext(): array
29
    {
30 2
        return $this->context;
31
    }
32
}
33