1 | <?php |
||
10 | class Tweet |
||
11 | { |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $id; |
||
16 | |||
17 | /** |
||
18 | * @var \DateTime |
||
19 | */ |
||
20 | private $created_at; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $text; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | private $retweet_count = 0; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | private $favorite_count = 0; |
||
36 | |||
37 | /** |
||
38 | * @var User |
||
39 | */ |
||
40 | private $user; |
||
41 | |||
42 | /** |
||
43 | * In timeline: false for retweeted Tweets. |
||
44 | */ |
||
45 | private $in_timeline = false; |
||
46 | |||
47 | /** |
||
48 | * @var Tweet |
||
49 | */ |
||
50 | private $retweeted_status = null; |
||
51 | |||
52 | /** |
||
53 | * @var ArrayCollection |
||
54 | */ |
||
55 | private $retweeting_statuses; |
||
56 | |||
57 | /** |
||
58 | * @var ArrayCollection |
||
59 | */ |
||
60 | private $medias; |
||
61 | |||
62 | 14 | public function __construct() |
|
67 | |||
68 | /** |
||
69 | * Set id. |
||
70 | * |
||
71 | * @return Tweet |
||
72 | */ |
||
73 | 14 | public function setId(int $id) |
|
79 | |||
80 | /** |
||
81 | * Get id. |
||
82 | * |
||
83 | * @return int |
||
84 | */ |
||
85 | 9 | public function getId(): int |
|
89 | |||
90 | /** |
||
91 | * Set created_at. |
||
92 | * |
||
93 | * @param \DateTime $createdAt |
||
94 | * |
||
95 | * @return Tweet |
||
96 | */ |
||
97 | 14 | public function setCreatedAt(\DateTime $createdAt) |
|
103 | |||
104 | /** |
||
105 | * Get created_at. |
||
106 | * |
||
107 | * @return \DateTime |
||
108 | */ |
||
109 | 10 | public function getCreatedAt() |
|
113 | |||
114 | /** |
||
115 | * Set text. |
||
116 | * |
||
117 | * @param string $text |
||
118 | * |
||
119 | * @return Tweet |
||
120 | */ |
||
121 | 14 | public function setText($text) |
|
127 | |||
128 | /** |
||
129 | * Get text. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | 11 | public function getText() |
|
137 | |||
138 | 6 | public function getTextLinkified() |
|
147 | |||
148 | /** |
||
149 | * Set retweet_count. |
||
150 | * |
||
151 | * @param int $retweetCount |
||
152 | * |
||
153 | * @return Tweet |
||
154 | */ |
||
155 | 14 | public function setRetweetCount($retweetCount) |
|
161 | |||
162 | /** |
||
163 | * Get retweet_count. |
||
164 | * |
||
165 | * @return int |
||
166 | */ |
||
167 | 8 | public function getRetweetCount() |
|
171 | |||
172 | /** |
||
173 | * Set favorite_count. |
||
174 | * |
||
175 | * @param int $favoriteCount |
||
176 | * |
||
177 | * @return Tweet |
||
178 | */ |
||
179 | 14 | public function setFavoriteCount($favoriteCount) |
|
185 | |||
186 | /** |
||
187 | * Get favorite_count. |
||
188 | * |
||
189 | * @return int |
||
190 | */ |
||
191 | 8 | public function getFavoriteCount() |
|
195 | |||
196 | /** |
||
197 | * Set user. |
||
198 | * |
||
199 | * @param User $user |
||
200 | * |
||
201 | * @return Tweet |
||
202 | */ |
||
203 | 14 | public function setUser(User $user) |
|
210 | |||
211 | /** |
||
212 | * Get User. |
||
213 | * |
||
214 | * @return User |
||
215 | */ |
||
216 | 9 | public function getUser() |
|
220 | |||
221 | /** |
||
222 | * Set in timeline. |
||
223 | * |
||
224 | * @param bool $inTimeline |
||
225 | * |
||
226 | * @return Tweet |
||
227 | */ |
||
228 | 14 | public function setInTimeline($inTimeline) |
|
234 | |||
235 | /** |
||
236 | * Get in timeline. |
||
237 | * |
||
238 | * @return bool |
||
239 | */ |
||
240 | 2 | public function isInTimeline() |
|
244 | |||
245 | /** |
||
246 | * Set retweeted |
||
247 | * "This attribute contains a representation of the original Tweet |
||
248 | * that was retweeted.". |
||
249 | * |
||
250 | * @param self $retweetedStatus |
||
|
|||
251 | * |
||
252 | * @return Tweet |
||
253 | */ |
||
254 | 13 | public function setRetweetedStatus(self $retweetedStatus) |
|
260 | |||
261 | /** |
||
262 | * Get retweeted status. |
||
263 | * |
||
264 | * @return Tweet |
||
265 | */ |
||
266 | 7 | public function getRetweetedStatus() |
|
270 | |||
271 | /** |
||
272 | * Get medias. |
||
273 | * |
||
274 | * @return ArrayCollection |
||
275 | */ |
||
276 | 6 | public function getMedias() |
|
280 | |||
281 | /** |
||
282 | * Add a media. |
||
283 | * |
||
284 | * @param Media $media |
||
285 | * |
||
286 | * @return Tweet |
||
287 | */ |
||
288 | 13 | public function addMedia(Media $media) |
|
295 | |||
296 | /** |
||
297 | * Remove a media. |
||
298 | * |
||
299 | * @param Media $media |
||
300 | * |
||
301 | * @return Tweet |
||
302 | */ |
||
303 | public function removeMedia(Media $media) |
||
304 | { |
||
305 | $this->medias->removeElement($media); |
||
306 | $media->removeTweet($this); |
||
307 | |||
308 | return $this; |
||
309 | } |
||
310 | |||
311 | /** |
||
312 | * Get retweeting status. |
||
313 | * |
||
314 | * @return ArrayCollection |
||
315 | */ |
||
316 | public function getRetweetingStatuses() |
||
317 | { |
||
318 | return $this->retweeting_statuses; |
||
319 | } |
||
320 | |||
321 | /** |
||
322 | * Call setter functions. |
||
323 | * |
||
324 | * @param \stdClass $tweetTmp |
||
325 | * |
||
326 | * @return Tweet |
||
327 | */ |
||
328 | 3 | public function setValues(\stdClass $tweetTmp) |
|
338 | |||
339 | /** |
||
340 | * Check that tweet can be deleted. |
||
341 | * |
||
342 | * @param int $tweetId |
||
343 | * |
||
344 | * @return bool |
||
345 | */ |
||
346 | public function mustBeKept($tweetId) |
||
363 | } |
||
364 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.