Lines
33.33%
1 / 3
Functions and Methods
33.33%
1 / 3
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| WorkerExposedButton | 33.33% | 1 / 3 | 33.33% | 1 / 3 | 5.67 | 0.00% | 0 / 1 | |||
| getConfig | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| updateConfig | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| watchCommands | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Worker\Exposure; | |
| 6 | ||
| 7 | use Stewart\Contracts\EventStream; | |
| 8 | use Stewart\Contracts\Exposure\ButtonConfig; | |
| 9 | use Stewart\Contracts\Exposure\Command\ButtonPress; | |
| 10 | use Stewart\Contracts\Exposure\ExposedButton; | |
| 11 | ||
| 12 | /** @extends WorkerExposedEntity<ButtonConfig> */ | |
| 13 | final class WorkerExposedButton extends WorkerExposedEntity implements ExposedButton | |
| 14 | { | |
| 15 | public function getConfig(): ButtonConfig | |
| 16 | { | |
| 17 | return $this->findConfig(); | |
| 18 | } | |
| 19 | ||
| 20 | public function updateConfig(ButtonConfig $config): void | |
| 21 | { | |
| 22 | $this->sendReconfiguration($config); | |
| 23 | } | |
| 24 | ||
| 25 | public function watchCommands(): EventStream | |
| 26 | { | |
| 27 | /** @var EventStream<ButtonPress> */ | |
| 28 | return $this->watchOwnCommands(); | |
| 29 | } | |
| 30 | } |