original_string: public function getAvatarImage(): ?ImageMedium
      {
          $avatars = $this->get('avatar');
          if (\is_array($avatars) && $avatars) {
              $avatar = array_shift($avatars);
  
              $media = $this->getMedia();
              $name = $avatar['name'] ?? null;
  
              $image = $name ? $media[$name] : null;
              if ($image instanceof ImageMedium) {
                  return $image;
              }
          }
  
          return null;
      }
code: public function getAvatarImage(): ?ImageMedium
      {
          $avatars = $this->get('avatar');
          if (\is_array($avatars) && $avatars) {
              $avatar = array_shift($avatars);
  
              $media = $this->getMedia();
              $name = $avatar['name'] ?? null;
  
              $image = $name ? $media[$name] : null;
              if ($image instanceof ImageMedium) {
                  return $image;
              }
          }
  
          return null;
      }
code_tokens: public function getAvatarImage ( ) : ? ImageMedium { $ avatars = $ this -> get ( 'avatar' ) ; if ( \ is_array ( $ avatars ) && $ avatars ) { $ avatar = array_shift ( $ avatars ) ; $ media = $ this -> getMedia ( ) ; $ name = $ avatar [ 'name' ] ?? null ; $ image = $ name ? $ media [ $ name ] : null ; if ( $ image instanceof ImageMedium ) { return $ image ; } } return null ; }
docstring: Return media object for the User's avatar.
  
  Note: if there's no local avatar image for the user, you should call getAvatarUrl() to get the external avatar URL.
  
  @return ImageMedium|null
docstring_tokens: Return media object for the User s avatar .