This is the code I'm playing with:
$options = [
# geocode element has the correct format according to Twitter documentation
'geocode'=> '53.3242381,-6.3857848,1mi',
'lang' => 'en',
'locale' => 'IE',
'result_type' => 'recent',
'include_entities' => false,
];
$res = $twitter->searchTweets("Leo Varadkar", $options)->getRawResponse();
I get this error: "geocode" must be of the format "latitude,longitude,radius".
Digging a bit I found bug in the Twitter class line 695.
case 'geocode':
/*line 695*/ if (!substr_count($value, ',') !== 2) {
throw new Exception\InvalidArgumentException(
'"geocode" must be of the format "latitude,longitude,radius"'
);
}
Should be if (substr_count($value, ',') !== 2) not if (!substr_count($value, ',') !== 2).
Please notice I removed the negation "!" in front of "substr_count" function.