TijsVerkoyen\Twitter\Twitter::friendshipsDestroy PHP Метод

friendshipsDestroy() публичный Метод

Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. Actions taken in this method are asynchronous and changes will be eventually consistent.
public friendshipsDestroy ( string[optional] $userId = null, string[optional] $screenName = null ) : array
$userId string[optional]
$screenName string[optional]
Результат array
    public function friendshipsDestroy($userId = null, $screenName = null)
    {
        // validate
        if ($userId == '' && $screenName == '') {
            throw new Exception('Specify an userId or a screenName.');
        }
        // build parameters
        if ($userId != null) {
            $parameters['user_id'] = (string) $userId;
        }
        if ($screenName != null) {
            $parameters['screen_name'] = (string) $screenName;
        }
        // make the call
        return $this->doCall('friendships/destroy.json', $parameters, true, 'POST');
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->friendshipsDestroy
  */
 public function testFriendshipsDestroy()
 {
     $response = $this->twitter->friendshipsCreate(null, 'tijsverkoyen');
     $response = $this->twitter->friendshipsDestroy(null, 'tijsverkoyen');
     $this->isUser($response);
 }
Twitter