Total Complexity | 6 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | final class ResourceErrorContext extends AbstractContext |
||
10 | { |
||
11 | /** @psalm-suppress InvalidClassConstantType */ |
||
12 | public const TYPE = 'bear_resource_error'; |
||
13 | |||
14 | /** @psalm-suppress InvalidClassConstantType */ |
||
15 | public const SCHEMA_URL = 'https://bearsunday.github.io/BEAR.Resource/schemas/bear-resource-error.json'; |
||
16 | |||
17 | public readonly string $exceptionId; |
||
18 | |||
19 | public function __construct( |
||
20 | public readonly string $exceptionClass, |
||
21 | public readonly string $exceptionMessage, |
||
22 | string $exceptionId = '', |
||
23 | ) { |
||
24 | $this->exceptionId = $exceptionId !== '' ? $exceptionId : $this->createExceptionId(); |
||
|
|||
25 | } |
||
26 | |||
27 | private function createExceptionId(): string |
||
39 | } |
||
40 | } |
||
41 |