Lines
0.00%
0 / 3
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| TopicError | 0.00% | 0 / 3 | 0.00% | 0 / 1 | 12 | 0.00% | 0 / 1 | |||
| messageTemplate | 0.00% | 0 / 3 | 0.00% | 0 / 1 | 12 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Contracts\Exception; | |
| 6 | ||
| 7 | enum TopicError: string implements ExceptionReason | |
| 8 | { | |
| 9 | case PayloadInvalid = 'payload_invalid'; | |
| 10 | case PublishFailed = 'publish_failed'; | |
| 11 | ||
| 12 | public function messageTemplate(): string | |
| 13 | { | |
| 14 | return match ($this) { | |
| 15 | self::PayloadInvalid => 'Topic payload at {path} is {actualType}; expected null, a finite scalar or an array of those.', | |
| 16 | self::PublishFailed => 'Could not publish to topic {topic}: {cause}', | |
| 17 | }; | |
| 18 | } | |
| 19 | } |