Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | final class InvalidRecordInSet extends Exception |
||
14 | { |
||
15 | /** |
||
16 | * @return InvalidRecordInSet |
||
17 | */ |
||
18 | public static function missingTopic(): self |
||
19 | { |
||
20 | return new self('You have to set "topic" to your message.'); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @param string $topic |
||
25 | * @return InvalidRecordInSet |
||
26 | */ |
||
27 | public static function nonExististingTopic(string $topic): self |
||
28 | { |
||
29 | return new self(sprintf('Requested topic "%s" does not exist. Did you forget to create it?', $topic)); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return InvalidRecordInSet |
||
34 | */ |
||
35 | public static function topicIsNotString(): self |
||
36 | { |
||
37 | return new self('Topic must be string.'); |
||
38 | } |
||
39 | |||
40 | public static function missingValue(): self |
||
41 | { |
||
42 | return new self('You have to set "value" to your message.'); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return InvalidRecordInSet |
||
47 | */ |
||
48 | public static function valueIsNotString(): self |
||
51 | } |
||
52 | } |
||
53 |