Lines
75.00%
3 / 4
Functions and Methods
75.00%
3 / 4
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| RemoveExposedEntity | 75.00% | 3 / 4 | 75.00% | 3 / 4 | 4.25 | 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 | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 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\Component; | |
| 6 | ||
| 7 | use Stewart\Client\Component\ExposedEntityAddress; | |
| 8 | use Stewart\Client\Connection\Command\HaCommand; | |
| 9 | ||
| 10 | final readonly class RemoveExposedEntity implements HaCommand | |
| 11 | { | |
| 12 | public function __construct(public ExposedEntityAddress $address) {} | |
| 13 | ||
| 14 | public function type(): string | |
| 15 | { | |
| 16 | return 'stewart/entity/remove'; | |
| 17 | } | |
| 18 | ||
| 19 | public function describe(): string | |
| 20 | { | |
| 21 | return \sprintf('%s %s', $this->type(), $this->address->describe()); | |
| 22 | } | |
| 23 | ||
| 24 | public function toMessage(): array | |
| 25 | { | |
| 26 | return ['type' => $this->type(), ...$this->address->toMessageFields()]; | |
| 27 | } | |
| 28 | } |