jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
776 stars 234 forks source link

Calling statuses_retweet_ID shows PHP Warning #130

Closed zhexiao closed 9 years ago

zhexiao commented 9 years ago

When i using this function :

statuses_retweet_ID(['id' => $inputArray['object_id']]);

it's return a error:

<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message:  strtolower() expects parameter 1 to be string, array given</p>
<p>Filename: codebird/codebird.php</p>
<p>Line Number: 571</p>
<div>

Fixed Solution: In function _mapFnToApiMethod(), change

"$param_l = strtolower($param); "

to

"$param_l = strtolower($param[0]);"
mynetx commented 9 years ago

Which Codebird version are you using?

zhexiao commented 9 years ago
/**
 * A Twitter library in PHP.
 *
 * @package   codebird
 * @version   3.0.0-dev
 * @author    Jublo Solutions <support@jublo.net>
 * @copyright 2010-2015 Jublo Solutions <support@jublo.net>
 * @license   http://opensource.org/licenses/GPL-3.0 GNU General Public License 3.0
 * @link      https://github.com/jublonet/codebird-php
 */
mynetx commented 9 years ago

what does print_r($inputArray['object_id']); show?

zhexiao commented 9 years ago

$inputArray['object_id'] is a tweet id from twitter api home_timeline.

mynetx commented 9 years ago

Thanks @zhexiao! This is now fixed.

zhexiao commented 9 years ago

No problem.