Lines 0.00% 0 / 2
Functions and Methods 0.00% 0 / 2
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
UpdateExposedEntityRequest 0.00% 0 / 2 0.00% 0 / 2 6 0.00% 0 / 1
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 createUnreachableFailure 0.00% 0 / 1 0.00% 0 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Ipc\Message;
6
7use Stewart\Contracts\Exception\ExposureException;
8use Stewart\Contracts\Exposure\ExposedEntityKey;
9use Stewart\Contracts\Exposure\ExposedStateChange;
10use Stewart\Runtime\Model\CorrelationId;
11use Stewart\Runtime\Model\ResourceScope;
12use Throwable;
13
14#[IpcMessage(tag: 'update_exposed_entity_request')]
15final readonly class UpdateExposedEntityRequest implements WorkerMessage, HaCallRequest
16{
17    public function __construct(
18        public CorrelationId $correlationId,
19        public ResourceScope $scope,
20        public ExposedEntityKey $key,
21        public ExposedStateChange $change,
22    ) {}
23
24    public function createUnreachableFailure(string $detail, ?Throwable $previous = null): ExposureException
25    {
26        return ExposureException::unreachable($this->key, $detail, $previous);
27    }
28}