1 | <?php |
||
5 | class CouldNotCreateButton extends \Exception |
||
6 | { |
||
7 | /** |
||
8 | * Thrown when the button title is not provided. |
||
9 | * |
||
10 | * @return static |
||
11 | */ |
||
12 | public static function titleNotProvided() |
||
16 | |||
17 | /** |
||
18 | * Thrown when the button type is "web_url" but the url is not provided. |
||
19 | * |
||
20 | * @return static |
||
21 | */ |
||
22 | public static function urlNotProvided() |
||
26 | |||
27 | /** |
||
28 | * Thrown when the button type is "phone_number" but the number is not provided. |
||
29 | * |
||
30 | * @return static |
||
31 | */ |
||
32 | public static function phoneNumberNotProvided() |
||
36 | |||
37 | /** |
||
38 | * Thrown when the button type is "postback" but the postback data is not provided. |
||
39 | * |
||
40 | * @return static |
||
41 | */ |
||
42 | public static function postbackNotProvided() |
||
46 | |||
47 | /** |
||
48 | * Thrown when the button type is "postback" or "phone_number", |
||
49 | * but the data value is not provided for the payload. |
||
50 | * |
||
51 | * @param $type |
||
52 | * |
||
53 | * @return static |
||
54 | */ |
||
55 | public static function dataNotProvided($type) |
||
59 | |||
60 | /** |
||
61 | * Thrown when the title characters limit is exceeded. |
||
62 | * |
||
63 | * @param $title |
||
64 | * |
||
65 | * @return static |
||
66 | */ |
||
67 | public static function titleLimitExceeded($title) |
||
75 | |||
76 | /** |
||
77 | * Thrown when the payload characters limit is exceeded. |
||
78 | * |
||
79 | * @param mixed $data |
||
80 | * |
||
81 | * @return static |
||
82 | */ |
||
83 | public static function payloadLimitExceeded($data) |
||
91 | |||
92 | /** |
||
93 | * Thrown when the URL provided is not valid. |
||
94 | * |
||
95 | * @param $url |
||
96 | * |
||
97 | * @return static |
||
98 | */ |
||
99 | public static function invalidUrlProvided($url) |
||
103 | |||
104 | /** |
||
105 | * Thrown when the phone number provided is of invalid format. |
||
106 | * |
||
107 | * @param $phoneNumber |
||
108 | * |
||
109 | * @return static |
||
110 | */ |
||
111 | public static function invalidPhoneNumberProvided($phoneNumber) |
||
119 | |||
120 | /** |
||
121 | * Thrown when the postback is not valid. |
||
122 | * |
||
123 | * @param $postback |
||
124 | * |
||
125 | * @return static |
||
126 | */ |
||
127 | public static function invalidPostbackProvided($postback) |
||
131 | } |
||
132 |