1 | <?php |
||
10 | class CouldNotCreateButton extends Exception |
||
11 | { |
||
12 | /** |
||
13 | * Thrown when the button title is not provided. |
||
14 | * |
||
15 | * @return static |
||
16 | */ |
||
17 | public static function titleNotProvided(): self |
||
21 | |||
22 | /** |
||
23 | * Thrown when the button type is "web_url" but the url is not provided. |
||
24 | * |
||
25 | * @return static |
||
26 | */ |
||
27 | public static function urlNotProvided(): self |
||
31 | |||
32 | /** |
||
33 | * Thrown when the button type is "phone_number" but the number is not provided. |
||
34 | * |
||
35 | * @return static |
||
36 | */ |
||
37 | public static function phoneNumberNotProvided(): self |
||
41 | |||
42 | /** |
||
43 | * Thrown when the button type is "postback" but the postback data is not provided. |
||
44 | * |
||
45 | * @return static |
||
46 | */ |
||
47 | public static function postbackNotProvided(): self |
||
51 | |||
52 | /** |
||
53 | * Thrown when the title characters limit is exceeded. |
||
54 | * |
||
55 | * @param string $title |
||
56 | * |
||
57 | * @return static |
||
58 | */ |
||
59 | public static function titleLimitExceeded(string $title): self |
||
67 | |||
68 | /** |
||
69 | * Thrown when the payload characters limit is exceeded. |
||
70 | * |
||
71 | * @param mixed $data |
||
72 | * |
||
73 | * @return static |
||
74 | */ |
||
75 | public static function payloadLimitExceeded($data): self |
||
83 | |||
84 | /** |
||
85 | * Thrown when the URL provided is not valid. |
||
86 | * |
||
87 | * @param string $url |
||
88 | * |
||
89 | * @return static |
||
90 | */ |
||
91 | public static function invalidUrlProvided(string $url): self |
||
95 | |||
96 | /** |
||
97 | * Thrown when the phone number provided is of invalid format. |
||
98 | * |
||
99 | * @param string $phoneNumber |
||
100 | * |
||
101 | * @return static |
||
102 | */ |
||
103 | public static function invalidPhoneNumberProvided(string $phoneNumber): self |
||
111 | } |
||
112 |