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

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

The user specified in the id is blocked by the authenticated user and reported as a spammer.
public reportSpam ( string[optional] $screenName = null, string[optional] $userId = null ) : array
$screenName string[optional]
$userId string[optional]
Результат 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');
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->reportSpam()
  */
 public function testReportSpam()
 {
     $response = $this->twitter->reportSpam('FujitaKatsuhisa');
     $this->isUser($response);
 }
Twitter