InternalException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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