InternalException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 20
ccs 3
cts 3
cp 1
rs 10
c 3
b 0
f 0
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 array<mixed, mixed> $context
14
     */
15
    public function __construct(
16 12
        string $message,
17
        int $code,
18
        null|Throwable $previous = null,
19
        private readonly array $context = [],
20
    ) {
21
        parent::__construct($message, $code, $previous);
22 12
    }
23
24
    /**
25
     * @return array<mixed, mixed>
26
     */
27
    public function getContext(): array
28 2
    {
29
        return $this->context;
30 2
    }
31
}
32