Lines
0.00%
0 / 3
Functions and Methods
0.00%
0 / 3
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| EventFireRequest | 0.00% | 0 / 3 | 0.00% | 0 / 3 | 12 | 0.00% | 0 / 1 | |||
| __construct | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| createUnreachableFailure | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| createOverloadedFailure | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Ipc\Message; | |
| 6 | ||
| 7 | use Stewart\Contracts\Exception\EventFireError; | |
| 8 | use Stewart\Contracts\Exception\EventFireException; | |
| 9 | use Stewart\Runtime\Model\CorrelationId; | |
| 10 | use Stewart\Runtime\Model\ResourceScope; | |
| 11 | use Throwable; | |
| 12 | ||
| 13 | #[IpcMessage(tag: 'event_fire_request')] | |
| 14 | final readonly class EventFireRequest implements WorkerMessage, RefusableHaCallRequest | |
| 15 | { | |
| 16 | /** @param array<string, mixed> $data */ | |
| 17 | public function __construct( | |
| 18 | public CorrelationId $correlationId, | |
| 19 | public ResourceScope $scope, | |
| 20 | public string $eventType, | |
| 21 | public array $data, | |
| 22 | ) {} | |
| 23 | ||
| 24 | public function createUnreachableFailure(string $detail, ?Throwable $previous = null): EventFireException | |
| 25 | { | |
| 26 | return EventFireException::unreachable($this->eventType, $detail, $previous); | |
| 27 | } | |
| 28 | ||
| 29 | public function createOverloadedFailure(string $detail): EventFireException | |
| 30 | { | |
| 31 | return EventFireException::createForReason(EventFireError::Overloaded, eventType: $this->eventType, detail: $detail); | |
| 32 | } | |
| 33 | } |