TijsVerkoyen\Twitter\Twitter::favoritesDestroy PHP Method

favoritesDestroy() public method

This process invoked by this method is asynchronous. The immediately returned status may not indicate the resultant favorited status of the tweet. A 200 OK response from this method will indicate whether the intended action was successful or not.
public favoritesDestroy ( string $id, bool[optional] $includeEntities = null ) : array
$id string The numerical ID of the desired status.
$includeEntities bool[optional]
return array
    public function favoritesDestroy($id, $includeEntities = null)
    {
        // build parameters
        $parameters['id'] = (string) $id;
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('favorites/destroy.json', $parameters, true, 'POST');
    }

Usage Example

 /**
  * Tests Twitter->favoritesCreate
  */
 public function testFavoritesCreate()
 {
     $response = $this->twitter->favoritesCreate('243138128959913986');
     $this->twitter->favoritesDestroy('243138128959913986');
     $this->isTweet($response);
 }
Twitter