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