1 | <?php |
||
7 | class FlockMessage |
||
8 | { |
||
9 | /** |
||
10 | * @var array Parameters payload |
||
11 | */ |
||
12 | public $payload = []; |
||
13 | |||
14 | /** |
||
15 | * @param string $content |
||
16 | * |
||
17 | * @return static |
||
18 | */ |
||
19 | 2 | public static function create($content = '') |
|
23 | |||
24 | /** |
||
25 | * Message constructor. |
||
26 | * |
||
27 | * @param string $content |
||
28 | */ |
||
29 | 5 | public function __construct($content = '') |
|
33 | |||
34 | /** |
||
35 | * Notification message. |
||
36 | * |
||
37 | * @param string $content |
||
38 | * |
||
39 | * @return $this |
||
40 | */ |
||
41 | 5 | public function content($content) |
|
47 | |||
48 | /** |
||
49 | * Message body as FlockML. |
||
50 | * |
||
51 | * @param string $content |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function flockml($content) |
||
61 | |||
62 | /** |
||
63 | * Text to be shown as the message's notification. (Default is text.) |
||
64 | * |
||
65 | * @param string $notification |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function notification($notification) |
||
75 | |||
76 | /** |
||
77 | * This field is used this if the sender would want to display |
||
78 | * another name and image as the sender. |
||
79 | * |
||
80 | * @param string $name |
||
81 | * @param string $profileImage |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function sendAs($name, $profileImage = null) |
||
104 | |||
105 | /** |
||
106 | * Returns params payload. |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | 2 | public function toArray() |
|
114 | |||
115 | /** |
||
116 | * Define an attachment for the message. |
||
117 | * |
||
118 | * @param \Closure $callback |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function attachments(Closure $callback) |
||
129 | } |
||
130 |