public friendshipsCreate ( string[optional] $userId = null, string[optional] $screenName = null, bool[optional] $follow = false ) : array | ||
$userId | string[optional] | |
$screenName | string[optional] | |
$follow | bool[optional] | |
Результат | array |
public function friendshipsCreate($userId = null, $screenName = null, $follow = false)
{
// 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;
}
$parameters['follow'] = $follow ? 'true' : 'false';
// make the call
return $this->doCall('friendships/create.json', $parameters, true, 'POST');
}
/** * Tests Twitter->friendshipsDestroy */ public function testFriendshipsDestroy() { $response = $this->twitter->friendshipsCreate(null, 'tijsverkoyen'); $response = $this->twitter->friendshipsDestroy(null, 'tijsverkoyen'); $this->isUser($response); }