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 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| RegistryEntityUpdateRequest | 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\Entity\EntityId; | |
| 8 | use Stewart\Contracts\Exception\RegistryEditError; | |
| 9 | use Stewart\Contracts\Exception\RegistryEditException; | |
| 10 | use Stewart\Contracts\Registry\Update\EntityRegistryUpdate; | |
| 11 | use Stewart\Runtime\Model\CorrelationId; | |
| 12 | use Stewart\Runtime\Model\ResourceScope; | |
| 13 | use Throwable; | |
| 14 | ||
| 15 | #[IpcMessage(tag: 'registry_entity_update_request')] | |
| 16 | final readonly class RegistryEntityUpdateRequest implements WorkerMessage, RefusableHaCallRequest | |
| 17 | { | |
| 18 | public function __construct( | |
| 19 | public CorrelationId $correlationId, | |
| 20 | public ResourceScope $scope, | |
| 21 | public EntityId $entityId, | |
| 22 | public EntityRegistryUpdate $update, | |
| 23 | ) {} | |
| 24 | ||
| 25 | public function createUnreachableFailure(string $detail, ?Throwable $previous = null): RegistryEditException | |
| 26 | { | |
| 27 | return RegistryEditException::unreachable($this->entityId, $detail, $previous); | |
| 28 | } | |
| 29 | ||
| 30 | public function createOverloadedFailure(string $detail): RegistryEditException | |
| 31 | { | |
| 32 | return RegistryEditException::createForReason(RegistryEditError::Overloaded, entityId: $this->entityId->value, detail: $detail); | |
| 33 | } | |
| 34 | } |