public followersList ( string[optional] $userId = null, string[optional] $screenName = null, int[optional] $cursor = null, bool[optional] $includeEntities = null, bool[optional] $skipStatus = null ) : array | ||
$userId | string[optional] | |
$screenName | string[optional] | |
$cursor | int[optional] | |
$includeEntities | bool[optional] | |
$skipStatus | bool[optional] | |
return | array |
public function followersList($userId = null, $screenName = null, $cursor = null, $includeEntities = null, $skipStatus = null)
{
// validate
if ($userId == '' && $screenName == '') {
throw new Exception('Specify an userId or a screenName.');
}
// build parameters
$parameters = null;
if ($userId != null) {
$parameters['user_id'] = (string) $userId;
}
if ($screenName != null) {
$parameters['screen_name'] = (string) $screenName;
}
if ($cursor !== null) {
$parameters['cursor'] = (int) $cursor;
}
if ($includeEntities !== null) {
$parameters['include_user_entities'] = $includeEntities ? 'true' : 'false';
}
if ($skipStatus !== null) {
$parameters['skip_status'] = $skipStatus ? 'true' : 'false';
}
// make the call
return $this->doCall('followers/list.json', $parameters, true);
}
/** * Tests Twitter->followersList */ public function testFollowersList() { $response = $this->twitter->followersList(null, 'tijsverkoyen'); $this->assertArrayHasKey('users', $response); $this->assertArrayHasKey('next_cursor', $response); $this->assertArrayHasKey('previous_cursor', $response); }