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

InternalException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

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