TijsVerkoyen\Twitter\Twitter::blocksDestroy PHP Method

blocksDestroy() public method

Un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful. If relationships existed before the block was instated, they will not be restored.
public blocksDestroy ( string[optional] $userId = null, string[optional] $screenName = null, bool[optional] $includeEntities = null, bool[optional] $skipStatus = null ) : array
$userId string[optional]
$screenName string[optional]
$includeEntities bool[optional]
$skipStatus bool[optional]
return array
    public function blocksDestroy($userId = null, $screenName = null, $includeEntities = null, $skipStatus = 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;
        }
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('blocks/destroy.json', $parameters, true, 'POST');
    }

Usage Example

 /**
  * Tests Twitter->blocksCreate
  */
 public function testBlocksDestroy()
 {
     $response = $this->twitter->blocksCreate(null, 'netlash');
     $response = $this->twitter->blocksDestroy(null, 'netlash');
     $this->isUser($response);
 }
Twitter