Lines
0.00%
0 / 9
Methods
0.00%
0 / 1
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| messageTemplate | 0.00% | 0 / 9 | 0.00% | 0 / 1 | 90 | ||
| 7 | enum TriggerError: string implements ExceptionReason | |
| 8 | { | |
| 9 | case ConfigInvalid = 'config_invalid'; | |
| 10 | case ConfigUnencodable = 'config_unencodable'; | |
| 11 | case ListEmpty = 'list_empty'; | |
| 12 | case TimeInvalid = 'time_invalid'; | |
| 13 | case TimePatternEmpty = 'time_pattern_empty'; | |
| 14 | case TemplateEmpty = 'template_empty'; | |
| 15 | case ZoneInvalid = 'zone_invalid'; | |
| 16 | case VariablesNotMap = 'variables_not_map'; | |
| 17 | ||
| 18 | public function messageTemplate(): string | |
| 19 | { | |
| 20 | return match ($this) { | |
| 21 | self::ConfigInvalid => 'A Home Assistant trigger must be a map with a non-empty "trigger" or "platform" key.', | |
| 22 | self::ConfigUnencodable => 'Trigger value at {path} cannot be encoded as JSON.', | |
| 23 | self::ListEmpty => 'A trigger subscription needs at least one trigger.', | |
| 24 | self::TimeInvalid => 'Trigger time "{time}" is neither HH:MM[:SS] nor an input_datetime or sensor entity.', | |
| 25 | self::TimePatternEmpty => 'A time pattern trigger needs hours, minutes or seconds.', | |
| 26 | self::TemplateEmpty => 'A template trigger needs a non-empty template.', | |
| 27 | self::ZoneInvalid => 'Trigger zone "{zone}" is not a zone entity.', | |
| 28 | self::VariablesNotMap => 'Trigger variables must be a map keyed by variable name.', | |
| 29 | }; | |
| 30 | } | |
| 31 | } |