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

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

The author's most recent Tweet will be returned inline when possible.
public usersShow ( string[optional] $userId = null, string[optional] $screenName = null, bool[optional] $includeEntities = null ) : array
$userId string[optional]
$screenName string[optional]
$includeEntities bool[optional]
Результат array
    public function usersShow($userId = null, $screenName = null, $includeEntities = null)
    {
        // validate
        if ($userId == '' && $screenName == '') {
            throw new Exception('Specify an userId or a screenName.');
        }
        // build parameters
        $parameters = null;
        if ($userId != null) {
            $parameters['user_id'] = (string) $userId;
        }
        if ($screenName != null) {
            $parameters['screen_name'] = (string) $screenName;
        }
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : '0';
        }
        // make the call
        return $this->doCall('users/show.json', $parameters);
    }

Usage Example

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