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

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

Returns a map of the available size variations of the specified user's profile banner. If the user has not uploaded a profile banner, a HTTP 404 will be served instead.
public usersProfileBanner ( string[optional] $userId = null, string[optional] $screenName = null ) : array
$userId string[optional]
$screenName string[optional]
Результат array
    public function usersProfileBanner($userId = null, $screenName = 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;
        }
        return $this->doCall('users/profile_banner.json', $parameters, true);
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->usersProfileBanner
  */
 public function testUsersProfileBanner()
 {
     $response = $this->twitter->usersProfileBanner(null, 'tijs_dev');
     $this->assertArrayHasKey('sizes', $response);
     foreach ($response['sizes'] as $row) {
         $this->assertArrayHasKey('w', $row);
         $this->assertArrayHasKey('h', $row);
         $this->assertArrayHasKey('url', $row);
     }
 }
Twitter