You are here

public function TwitterAuthManager::getProfilePicture in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  2. 8 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  3. 8.2 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  4. 8.3 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  5. 8.4 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  6. 8.5 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  7. 8.6 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()
  8. 8.8 modules/custom/social_auth_twitter/src/TwitterAuthManager.php \Drupal\social_auth_twitter\TwitterAuthManager::getProfilePicture()

Returns URL of a profile picture.

Return value

string|null Absolute URL to a picture or Null if picture is not set.

Overrides AuthManagerInterface::getProfilePicture

File

modules/custom/social_auth_twitter/src/TwitterAuthManager.php, line 92

Class

TwitterAuthManager
Manages the authorization process before getting a long lived access token.

Namespace

Drupal\social_auth_twitter

Code

public function getProfilePicture() {
  if (($profile = $this
    ->getProfile()) && isset($profile->screen_name) && empty($profile->default_profile_image)) {
    return "https://twitter.com/{$profile->screen_name}/profile_image?size=original";
  }
}