1 | <?php |
||
9 | class TwitterStatusUpdate |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $content; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $images; |
||
18 | |||
19 | /** |
||
20 | * @var Collection |
||
21 | */ |
||
22 | public $imageIds; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $apiEndpoint = 'statuses/update'; |
||
28 | |||
29 | /* |
||
30 | * @param string $content |
||
31 | */ |
||
32 | 10 | public function __construct($content) |
|
40 | |||
41 | /** |
||
42 | * Set Twitter media files. |
||
43 | * |
||
44 | * @param array|string $images |
||
45 | * @return $this |
||
46 | */ |
||
47 | public function withImage($images) |
||
55 | |||
56 | /** |
||
57 | * Get Twitter status update content. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | 7 | public function getContent() |
|
65 | |||
66 | /** |
||
67 | * Get Twitter images list. |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | 6 | public function getImages() |
|
75 | |||
76 | /** |
||
77 | * Return Twitter status update api endpoint. |
||
78 | * @return string |
||
79 | */ |
||
80 | 3 | public function getApiEndpoint() |
|
84 | |||
85 | /** |
||
86 | * Build Twitter request body. |
||
87 | * @return array |
||
88 | */ |
||
89 | 4 | public function getRequestBody() |
|
101 | |||
102 | /** |
||
103 | * Check if the message length is too long. |
||
104 | * @param $content |
||
105 | * @param $brevity |
||
106 | * @return int |
||
107 | */ |
||
108 | 10 | private function messageIsTooLong($content, Brevity $brevity) |
|
115 | } |
||
116 |