Lines
50.00%
2 / 4
Functions and Methods
50.00%
2 / 4
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| GetEntityRegistryEntry | 50.00% | 2 / 4 | 50.00% | 2 / 4 | 6.00 | 0.00% | 0 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| type | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| describe | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| toMessage | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Client\Connection\Command; | |
| 6 | ||
| 7 | use Stewart\Contracts\Entity\EntityId; | |
| 8 | ||
| 9 | final readonly class GetEntityRegistryEntry implements HaCommand | |
| 10 | { | |
| 11 | public function __construct(public EntityId $entityId) {} | |
| 12 | ||
| 13 | public function type(): string | |
| 14 | { | |
| 15 | return 'config/entity_registry/get'; | |
| 16 | } | |
| 17 | ||
| 18 | public function describe(): string | |
| 19 | { | |
| 20 | return \sprintf('%s %s', $this->type(), $this->entityId->value); | |
| 21 | } | |
| 22 | ||
| 23 | public function toMessage(): array | |
| 24 | { | |
| 25 | return ['type' => $this->type(), 'entity_id' => $this->entityId->value]; | |
| 26 | } | |
| 27 | } |