Lines
100.00%
2 / 2
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| getValue | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 10 | final readonly class HaEvent | |
| 11 | { | |
| 12 | public const string STATE_CHANGED = 'state_changed'; | |
| 13 | ||
| 14 | /** @param array<string, mixed> $data */ | |
| 15 | public function __construct( | |
| 16 | public string $type, | |
| 17 | public array $data = [], | |
| 18 | public EventOrigin $origin = EventOrigin::Local, | |
| 19 | public ?Instant $firedAt = null, | |
| 20 | public ?EventContext $context = null, | |
| 21 | ) {} | |
| 22 | ||
| 23 | public function getValue(string $key): mixed | |
| 24 | { | |
| 25 | return $this->data[$key] ?? null; | |
| 26 | } | |
| 27 | } |