original_string: public static function getRealToken(Oauth_TokenModel $token)
      {
          $provider = craft()->oauth->getProvider($token->providerHandle);
  
          if($provider)
          {
              switch($provider->getOauthVersion())
              {
                  case 1:
                      return $provider->createAccessToken([
                          'identifier' => $token->accessToken,
                          'secret' => $token->secret,
                      ]);
  
                  case 2:
                      return $provider->createAccessToken([
                          'access_token' => $token->accessToken,
                          'refresh_token' => $token->refreshToken,
                          'secret' => $token->secret,
                          'expires' => $token->endOfLife,
                      ]);
              }
          }
      }
code: public static function getRealToken(Oauth_TokenModel $token)
      {
          $provider = craft()->oauth->getProvider($token->providerHandle);
  
          if($provider)
          {
              switch($provider->getOauthVersion())
              {
                  case 1:
                      return $provider->createAccessToken([
                          'identifier' => $token->accessToken,
                          'secret' => $token->secret,
                      ]);
  
                  case 2:
                      return $provider->createAccessToken([
                          'access_token' => $token->accessToken,
                          'refresh_token' => $token->refreshToken,
                          'secret' => $token->secret,
                          'expires' => $token->endOfLife,
                      ]);
              }
          }
      }
code_tokens: public static function getRealToken ( Oauth_TokenModel $ token ) { $ provider = craft ( ) -> oauth -> getProvider ( $ token -> providerHandle ) ; if ( $ provider ) { switch ( $ provider -> getOauthVersion ( ) ) { case 1 : return $ provider -> createAccessToken ( [ 'identifier' => $ token -> accessToken , 'secret' => $ token -> secret , ] ) ; case 2 : return $ provider -> createAccessToken ( [ 'access_token' => $ token -> accessToken , 'refresh_token' => $ token -> refreshToken , 'secret' => $ token -> secret , 'expires' => $ token -> endOfLife , ] ) ; } } }
docstring: Get real token
docstring_tokens: Get real token