1 | <?php |
||
10 | class Attachment |
||
11 | { |
||
12 | const COLOR_GOOD = 'good'; |
||
13 | const COLOR_WARNING = 'warning'; |
||
14 | const COLOR_DANGER = 'danger'; |
||
15 | |||
16 | /** |
||
17 | * The fallback text to use for clients that don't support attachments. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $fallback; |
||
22 | |||
23 | /** |
||
24 | * Optional text that should appear within the attachment. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $text = ''; |
||
29 | |||
30 | /** |
||
31 | * Optional image that should appear within the attachment. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $imageUrl; |
||
36 | |||
37 | /** |
||
38 | * Optional thumbnail that should appear within the attachment. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $thumbUrl; |
||
43 | |||
44 | /** |
||
45 | * Optional text that should appear above the formatted data. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $preText; |
||
50 | |||
51 | /** |
||
52 | * Optional title for the attachment. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $title; |
||
57 | |||
58 | /** |
||
59 | * Optional title link for the attachment. |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $titleLink; |
||
64 | |||
65 | /** |
||
66 | * Optional author name for the attachment. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $authorName; |
||
71 | |||
72 | /** |
||
73 | * Optional author link for the attachment. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | protected $authorLink; |
||
78 | |||
79 | /** |
||
80 | * Optional author icon for the attachment. |
||
81 | * |
||
82 | * @var string |
||
83 | */ |
||
84 | protected $authorIcon; |
||
85 | |||
86 | /** |
||
87 | * The color to use for the attachment. |
||
88 | * |
||
89 | * @var string |
||
90 | */ |
||
91 | protected $color; |
||
92 | |||
93 | /** |
||
94 | * The text to use for the attachment footer. |
||
95 | * |
||
96 | * @var string |
||
97 | */ |
||
98 | protected $footer; |
||
99 | |||
100 | /** |
||
101 | * The icon to use for the attachment footer. |
||
102 | * |
||
103 | * @var string |
||
104 | */ |
||
105 | protected $footerIcon; |
||
106 | |||
107 | /** |
||
108 | * The timestamp to use for the attachment. |
||
109 | * |
||
110 | * @var \DateTime |
||
111 | */ |
||
112 | protected $timestamp; |
||
113 | |||
114 | /** |
||
115 | * The callback id to use for the attachment. |
||
116 | * |
||
117 | * @var string |
||
118 | */ |
||
119 | protected $callbackId; |
||
120 | |||
121 | /** |
||
122 | * The fields of the attachment. |
||
123 | * |
||
124 | * @var \Illuminate\Support\Collection |
||
125 | */ |
||
126 | protected $fields; |
||
127 | |||
128 | /** |
||
129 | * Message Formatting. |
||
130 | * |
||
131 | * @var array $mrkdwn |
||
132 | */ |
||
133 | protected $mrkdwn = []; |
||
134 | |||
135 | /** |
||
136 | * The actions of the attachment. |
||
137 | * |
||
138 | * @var \Illuminate\Support\Collection |
||
139 | */ |
||
140 | protected $actions; |
||
141 | |||
142 | public static function create() |
||
146 | |||
147 | public function __construct() |
||
153 | |||
154 | /** |
||
155 | * Set the fallback text. |
||
156 | * |
||
157 | * @param string $fallback |
||
158 | * |
||
159 | * @return $this |
||
160 | */ |
||
161 | public function setFallback(string $fallback) |
||
167 | |||
168 | /** |
||
169 | * Set the optional text to appear within the attachment. |
||
170 | * |
||
171 | * @param string $text |
||
172 | * |
||
173 | * @return $this |
||
174 | */ |
||
175 | public function setText($text) |
||
181 | |||
182 | /** |
||
183 | * Set the optional image to appear within the attachment. |
||
184 | * |
||
185 | * @param string $imageUrl |
||
186 | * |
||
187 | * @return $this |
||
188 | */ |
||
189 | public function setImageUrl(string $imageUrl) |
||
195 | |||
196 | /** |
||
197 | * Set the optional thumbnail to appear within the attachment. |
||
198 | * |
||
199 | * @param string $thumbUrl |
||
200 | * |
||
201 | * @return $this |
||
202 | */ |
||
203 | public function setThumbUrl(string $thumbUrl) |
||
209 | |||
210 | /** |
||
211 | * Set the text that should appear above the formatted data. |
||
212 | * |
||
213 | * @param string $preText |
||
214 | * |
||
215 | * @return $this |
||
216 | */ |
||
217 | public function setPreText(string $preText) |
||
223 | |||
224 | /** |
||
225 | * Set the color to use for the attachment. |
||
226 | * |
||
227 | * @param string $color |
||
228 | * |
||
229 | * @return $this |
||
230 | */ |
||
231 | public function setColor($color) |
||
237 | |||
238 | /** |
||
239 | * Set the footer text to use for the attachment. |
||
240 | * |
||
241 | * @param string $footer |
||
242 | * |
||
243 | * @return $this |
||
244 | */ |
||
245 | public function setFooter(string $footer) |
||
251 | |||
252 | /** |
||
253 | * Set the footer icon to use for the attachment. |
||
254 | * |
||
255 | * @param string $footerIcon |
||
256 | * |
||
257 | * @return $this |
||
258 | */ |
||
259 | public function setFooterIcon(string $footerIcon) |
||
265 | |||
266 | /** |
||
267 | * Set the timestamp to use for the attachment. |
||
268 | * |
||
269 | * @param \DateTime $timestamp |
||
270 | * |
||
271 | * @return $this |
||
272 | */ |
||
273 | public function setTimestamp(DateTime $timestamp) |
||
279 | |||
280 | /** |
||
281 | * Set the title to use for the attachment. |
||
282 | * |
||
283 | * @param string $title |
||
284 | * |
||
285 | * @return $this |
||
286 | */ |
||
287 | public function setTitle(string $title) |
||
293 | |||
294 | /** |
||
295 | * Set the title link to use for the attachment. |
||
296 | * |
||
297 | * @param string $titleLink |
||
298 | * |
||
299 | * @return $this |
||
300 | */ |
||
301 | public function setTitleLink(string $titleLink) |
||
307 | |||
308 | /** |
||
309 | * Set the author name to use for the attachment. |
||
310 | * |
||
311 | * @param string $authorName |
||
312 | * |
||
313 | * @return $this |
||
314 | */ |
||
315 | public function setAuthorName(string $authorName) |
||
321 | |||
322 | /** |
||
323 | * Enable simple markup language. |
||
324 | * |
||
325 | * @param boolean $mrkdwn |
||
|
|||
326 | * |
||
327 | * @return $this |
||
328 | */ |
||
329 | public function setMarkdown(bool $setMrkdwn) |
||
337 | |||
338 | /** |
||
339 | * Set the auhtor link to use for the attachment. |
||
340 | * |
||
341 | * @param string $authorLink |
||
342 | * |
||
343 | * @return $this |
||
344 | */ |
||
345 | public function setAuthorLink(string $authorLink) |
||
351 | |||
352 | /** |
||
353 | * Set the author icon to use for the attachment. |
||
354 | * |
||
355 | * @param string $authorIcon |
||
356 | * |
||
357 | * @return $this |
||
358 | */ |
||
359 | public function setAuthorIcon(string $authorIcon) |
||
365 | |||
366 | /** |
||
367 | * Set the callback id to use for the attachment. |
||
368 | * |
||
369 | * @param string $callbackId |
||
370 | * |
||
371 | * @return $this |
||
372 | */ |
||
373 | public function setCallbackId(string $callbackId) |
||
379 | |||
380 | /** |
||
381 | * Add a field to the attachment. |
||
382 | * |
||
383 | * @param \Spatie\SlashCommand\AttachmentField|array $field |
||
384 | * |
||
385 | * @return $this |
||
386 | * |
||
387 | * @throws \Spatie\SlashCommand\Exceptions\FieldCannotBeAdded |
||
388 | */ |
||
389 | public function addField($field) |
||
406 | |||
407 | /** |
||
408 | * Add the fields for the attachment. |
||
409 | * |
||
410 | * @param array $fields |
||
411 | * |
||
412 | * @return $this |
||
413 | */ |
||
414 | public function addFields(array $fields) |
||
426 | |||
427 | /** |
||
428 | * Set the fields for the attachment. |
||
429 | * |
||
430 | * @param array $fields |
||
431 | * |
||
432 | * @return $this |
||
433 | */ |
||
434 | public function setFields(array $fields) |
||
442 | |||
443 | /** |
||
444 | * Clear all fields for this attachment. |
||
445 | * |
||
446 | * @return $this |
||
447 | */ |
||
448 | public function clearFields() |
||
454 | |||
455 | /** |
||
456 | * @param \Spatie\SlashCommand\AttachmentAction|array $action |
||
457 | * |
||
458 | * @return $this |
||
459 | * @throws \Spatie\SlashCommand\Exceptions\ActionCannotBeAdded |
||
460 | */ |
||
461 | public function addAction($action) |
||
479 | |||
480 | /** |
||
481 | * Add the actions for the attachment. |
||
482 | * |
||
483 | * @param array $actions |
||
484 | * |
||
485 | * @return $this |
||
486 | */ |
||
487 | public function addActions(array $actions) |
||
495 | |||
496 | /** |
||
497 | * Set the actions for the attachment. |
||
498 | * |
||
499 | * @param array $actions |
||
500 | * |
||
501 | * @return $this |
||
502 | */ |
||
503 | public function setActions(array $actions) |
||
511 | |||
512 | /** |
||
513 | * Clear all actions for this attachment. |
||
514 | * |
||
515 | * @return $this |
||
516 | */ |
||
517 | public function clearActions() |
||
523 | |||
524 | /** |
||
525 | * Convert this attachment to its array representation. |
||
526 | * |
||
527 | * @return array |
||
528 | */ |
||
529 | public function toArray() |
||
556 | } |
||
557 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.