public reportSpam ( string[optional] $screenName = null, string[optional] $userId = null ) : array | ||
$screenName | string[optional] | |
$userId | string[optional] | |
return | array |
public function reportSpam($screenName = null, $userId = null)
{
// validate
if ($userId == '' && $screenName == '') {
throw new Exception('One of these parameters must be provided.');
}
// build parameters
if ($userId != null) {
$parameters['user_id'] = (string) $userId;
}
if ($screenName != null) {
$parameters['screen_name'] = (string) $screenName;
}
// make the call
return $this->doCall('users/report_spam.json', $parameters, true, 'POST');
}
/** * Tests Twitter->reportSpam() */ public function testReportSpam() { $response = $this->twitter->reportSpam('FujitaKatsuhisa'); $this->isUser($response); }