8000 Changed: Don't rely on intval() for the large tweet id's that Snowfla… · UltraSimplified/codebird-php@10f25a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 10f25a8

Browse files
committed
Changed: Don't rely on intval() for the large tweet id's that Snowflake is generating nowadays.
1 parent 497d153 commit 10f25a8

File tree

1 file changed

+26
-33
lines changed
10000

1 file changed

+26
-33
lines changed

codebird.php

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,19 @@ public static function Blocks_Blocking_Ids($a)
181181
public static function Blocks_Create($a)
182182
{
183183
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
184-
return Codebird::CallApiPost('blocks/create/' . intval($a['id']), $a, true);
184+
return Codebird::CallApiPost('blocks/create/' . $a['id'], $a, true);
185185
}
186186

187187
public static function Blocks_Destroy($a)
188188
{
189189
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
190-
return Codebird::CallApiPost('blocks/destroy/' . intval($a['id']), $a, true);
190+
return Codebird::CallApiPost('blocks/destroy/' . $a['id'], $a, true);
191191
}
192192

193193
public static function Blocks_Exists($a)
194194
{
195195
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
196-
return Codebird::CallApiGet('blocks/exists/' . intval($a['id']), $a, true);
196+
return Codebird::CallApiGet('blocks/exists/' . $a['id'], $a, true);
197197
}
198198

199199
public static function DirectMessages($a)
@@ -204,8 +204,7 @@ public static function DirectMessages($a)
204204
public static function DirectMessages_Destroy($a)
205205
{
206206
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
207-
return Codebird::CallApiPost('direct_messages/destroy/' . intval($a['id']),
208-
$a, true);
207+
return Codebird::CallApiPost('direct_messages/destroy/' . $a['id'], $a, true);
209208
}
210209

211210
public static function DirectMessages_New($a)
@@ -226,13 +225,13 @@ public static function Favorites($a)
226225
public static function Favorites_Create($a)
227226
{
228227
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
229-
return Codebird::CallApiPost('favorites/create/' . intval($a['id']), $a, true);
228+
return Codebird::CallApiPost('favorites/create/' . $a['id'], $a, true);
230229
}
231230

232231
public static function Favorites_Destroy($a)
233232
{
234233
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
235-
return Codebird::CallApiPost('favorites/destroy/' . intval($a['id']), $a, true);
234+
return Codebird::CallApiPost('favorites/destroy/' . $a['id'], $a, true);
236235
}
237236
public static function Followers_Ids($a)
238237
{
@@ -247,14 +246,13 @@ public static function Friends_Ids($a)
247246
public static function Friendships_Create($a)
248247
{
249248
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
250-
return Codebird::CallApiPost('friendships/create/' . intval($a['id']), $a, true);
249+
return Codebird::CallApiPost('friendships/create/' . $a['id'], $a, true);
251250
}
252251

253252
public static function Friendships_Destroy($a)
254253
{
255254
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
256-
return Codebird::CallApiPost('friendships/destroy/' . intval($a['id']),
257-
$a, true);
255+
return Codebird::CallApiPost('friendships/destroy/' . $a['id'], $a, true);
258256
}
259257

260258
public static function Friendships_Exists($a)
@@ -270,7 +268,7 @@ public static function Friendships_Show($a)
270268
public static function Geo_Id($a)
271269
{
272270
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
273-
return Codebird::CallApiGet('geo/id/' . intval($a['id']), $a, true);
271+
return Codebird::CallApiGet('geo/id/' . $a['id'], $a, true);
274272
}
275273

276274
public static function Geo_NearbyPlaces($a)
@@ -316,15 +314,13 @@ public static function Legal_Tos()
316314
public static function Notifications_Follow($a)
317315
{
318316
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
319-
return Codebird::CallApiPost('notifications/follow/' . intval($a['id']),
320-
$a, true);
317+
return Codebird::CallApiPost('notifications/follow/' . $a['id'], $a, true);
321318
}
322319

323320
public static function Notifications_Leave($a)
324321
{
325322
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
326-
return Codebird::CallApiPost('notifications/leave/' . intval($a['id']),
327-
$a, true);
323+
return Codebird::CallApiPost('notifications/leave/' . $a['id'], $a, true);
328324
}
329325

330326
public static function Oauth_RequestToken($a)
@@ -334,8 +330,8 @@ public static function Oauth_RequestToken($a)
334330

335331
public static function Oauth_Authorize()
336332
{
337-
return 'https://api.twitter.com/oauth/authorize?oauth_token=' .
338-
Codebird::Url(Codebird::$token['k']);
333+
return 'https://api.twitter.com/oauth/authorize?oauth_token=' . Codebird::
334+
Url(Codebird::$token['k']);
339335
}
340336

341337
public static function Oauth_AccessToken($a)
@@ -361,22 +357,20 @@ public static function SavedSearches_Create($a)
361357
public static function SavedSearches_Destroy($a)
362358
{
363359
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
364-
return Codebird::CallApiPost('saved_searches/destroy/' . intval($a['id']),
365-
array(), true);
360+
return Codebird::CallApiPost('saved_searches/destroy/' . $a['id'], array
361+
(), true);
366362
}
367363

368364
public static function SavedSearches_Show($a)
369365
{
370366
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
371-
return Codebird::CallApiPost('saved_searches/show/' . intval($a['id']),
372-
$a, true);
367+
return Codebird::CallApiPost('saved_searches/show/' . $a['id'], $a, true);
373368
}
374369

375370
public static function Statuses_Destroy($a)
376371
{
377372
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
378-
return Codebird::CallApiPost('statuses/destroy/' . intval($a['id']),
379-
array(), true);
373+
return Codebird::CallApiPost('statuses/destroy/' . $a['id'], array(), true);
380374
}
381375

382376
public static function Statuses_Followers($a)
@@ -402,15 +396,14 @@ public static function Statuses_HomeTimeline($a)
402396
public static function Statuses_RetweetedBy($a)
403397
{
404398
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
405-
return Codebird::CallApiGet('statuses/' . intval($a['id']) .
406-
'/retweeted_by', $a, true);
399+
return Codebird::CallApiGet('statuses/' . $a['id'] . '/retweeted_by', $a, true);
407400
}
408401

409402
public static function Statuses_RetweetedBy_Ids($a)
410403
{
411404
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
412-
return Codebird::CallApiGet('statuses/' . intval($a['id']) .
413-
'/retweeted_by/ids', $a, true);
405+
return Codebird::CallApiGet('statuses/' . $a['id'] . '/retweeted_by/ids',
406+
$a, true);
414407
}
415408

416409
public static function Statuses_Mentions($a)
@@ -436,14 +429,13 @@ public static function Statuses_PublicTimeline()
436429
public static function Statuses_Retweet($a)
437430
{
438431
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
439-
return Codebird::CallApiPost('statuses/retweet/' . intval($a['id']),
440-
array(), true);
432+
return Codebird::CallApiPost('statuses/retweet/' . $a['id'], array(), true);
441433
}
442434

443435
public static function Statuses_Retweets($a)
444436
{
445437
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
446-
return Codebird::CallApiGet('statuses/retweets/' . intval($a['id']), $a, true);
438+
return Codebird::CallApiGet('statuses/retweets/' . $a['id'], $a, true);
447439
}
448440

449441
public static function Statuses_RetweetedByMe($a)
@@ -464,7 +456,7 @@ public static function Statuses_RetweetsOfMe($a)
464456
public static function Statuses_Show($a)
465457
{
466458
if (!isset($a['id'])) throw new Exception('Missing parameter id.');
467-
return Codebird::CallApiGet('statuses/show/' . intval($a['id']), $a, true);
459+
return Codebird::CallApiGet('statuses/show/' . $a['id'], $a, true);
468460
}
469461

470462
public static function Statuses_Update($a)
@@ -480,7 +472,7 @@ public static function Statuses_UserTimeline($a)
480472
public static function Trends($a)
481473
{
482474
if (!isset($a['woeid'])) throw new Exception('Missing parameter woeid.');
483-
return Codebird::CallApiGet('trends/' . intval($a['id']), $a, true);
475+
return Codebird::CallApiGet('trends/' . $a['id'], $a, true);
484476
}
485477

486478
public static function Trends_Available($a)
@@ -641,7 +633,8 @@ public static function Users_Lookup($a)
641633
public static function Users_ProfileImage($a)
642634
{
643635
if (!isset($a['screen_name'])) throw new Exception('Missing parameter screen_name.');
644-
return Codebird::CallApiGet('users/profile_image/' . $a['screen_name'], $a, true);
636+
return Codebird::CallApiGet('users/profile_image/' . $a['screen_name'],
637+
$a, true);
645638
}
646639

647640
public static function Users_Search($a)

0 commit comments

Comments
 (0)
0