1 | <?php |
||
15 | final class Builder |
||
16 | { |
||
17 | /** |
||
18 | * @var Attachment |
||
19 | */ |
||
20 | private $attachment; |
||
21 | |||
22 | /** |
||
23 | * @param Attachment $attachment |
||
24 | */ |
||
25 | public function __construct(Attachment $attachment) |
||
29 | |||
30 | /** |
||
31 | * Get the attachment in the format that slack requires. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function build() |
||
53 | |||
54 | /** |
||
55 | * If set, add the colour to the attachment. |
||
56 | * |
||
57 | * @param array $attachment |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | private function addColourToAttachment(array $attachment) |
||
71 | |||
72 | /** |
||
73 | * If set, add the text to the attachment. |
||
74 | * |
||
75 | * @param array $attachment |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | private function addTextToAttachment(array $attachment) |
||
89 | |||
90 | /** |
||
91 | * If set, add the pretext to the attachment. |
||
92 | * |
||
93 | * @param array $attachment |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | private function addPretextToAttachment(array $attachment) |
||
107 | |||
108 | /** |
||
109 | * If set, add the author to the attachment. |
||
110 | * |
||
111 | * @param array $attachment |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | private function addAuthorToAttachment(array $attachment) |
||
133 | |||
134 | /** |
||
135 | * If set, add the title to the attachment. |
||
136 | * |
||
137 | * @param array $attachment |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | private function addTitleToAttachment(array $attachment) |
||
155 | |||
156 | /** |
||
157 | * If set, add the fields to the attachment. |
||
158 | * |
||
159 | * @param array $attachment |
||
160 | * |
||
161 | * @return array |
||
162 | */ |
||
163 | private function addFieldsToAttachment(array $attachment) |
||
173 | |||
174 | /** |
||
175 | * If set, add the image to the attachment. |
||
176 | * |
||
177 | * @param array $attachment |
||
178 | * |
||
179 | * @return array |
||
180 | */ |
||
181 | private function addImageToAttachment(array $attachment) |
||
191 | |||
192 | /** |
||
193 | * If set, add the thumbnail to the attachment. |
||
194 | * |
||
195 | * @param array $attachment |
||
196 | * |
||
197 | * @return array |
||
198 | */ |
||
199 | private function addThumbnailToAttachment(array $attachment) |
||
209 | |||
210 | /** |
||
211 | * If set, add the fields to the attachment. |
||
212 | * |
||
213 | * @param array $attachment |
||
214 | * |
||
215 | * @return array |
||
216 | */ |
||
217 | private function addMarkdownSettingsToAttachment(array $attachment) |
||
227 | } |
||
228 |