original_string: public static function realTokenToArray($token)
      {
          $class = get_class($token);
  
          $tokenArray = array(
              'class' => $class,
  
              // 'extraParams' => $token->getExtraParams(),
          );
  
          if(get_class($token) === 'League\OAuth1\Client\Credentials\TokenCredentials' || is_subclass_of($token, '\League\OAuth1\Client\Credentials\TokenCredentials'))
          {
              // OAuth 1.0
              $tokenArray['identifier'] = $token->getIdentifier();
              $tokenArray['secret'] = $token->getSecret();
          }
          elseif(get_class($token) === 'League\OAuth2\Client\Token\AccessToken' || is_subclass_of($token, '\League\OAuth2\Client\Token\AccessToken'))
          {
              // OAuth 2.0
              $tokenArray['accessToken'] = $token->getToken();
              $tokenArray['refreshToken'] = $token->getRefreshToken();
              $tokenArray['endOfLife'] = $token->getExpires();
          }
  
          return $tokenArray;
      }
code: public static function realTokenToArray($token)
      {
          $class = get_class($token);
  
          $tokenArray = array(
              'class' => $class,
  
              // 'extraParams' => $token->getExtraParams(),
          );
  
          if(get_class($token) === 'League\OAuth1\Client\Credentials\TokenCredentials' || is_subclass_of($token, '\League\OAuth1\Client\Credentials\TokenCredentials'))
          {
              // OAuth 1.0
              $tokenArray['identifier'] = $token->getIdentifier();
              $tokenArray['secret'] = $token->getSecret();
          }
          elseif(get_class($token) === 'League\OAuth2\Client\Token\AccessToken' || is_subclass_of($token, '\League\OAuth2\Client\Token\AccessToken'))
          {
              // OAuth 2.0
              $tokenArray['accessToken'] = $token->getToken();
              $tokenArray['refreshToken'] = $token->getRefreshToken();
              $tokenArray['endOfLife'] = $token->getExpires();
          }
  
          return $tokenArray;
      }
code_tokens: public static function realTokenToArray ( $ token ) { $ class = get_class ( $ token ) ; $ tokenArray = array ( 'class' => $ class , // 'extraParams' => $token->getExtraParams(), ) ; if ( get_class ( $ token ) === 'League\OAuth1\Client\Credentials\TokenCredentials' || is_subclass_of ( $ token , '\League\OAuth1\Client\Credentials\TokenCredentials' ) ) { // OAuth 1.0 $ tokenArray [ 'identifier' ] = $ token -> getIdentifier ( ) ; $ tokenArray [ 'secret' ] = $ token -> getSecret ( ) ; } elseif ( get_class ( $ token ) === 'League\OAuth2\Client\Token\AccessToken' || is_subclass_of ( $ token , '\League\OAuth2\Client\Token\AccessToken' ) ) { // OAuth 2.0 $ tokenArray [ 'accessToken' ] = $ token -> getToken ( ) ; $ tokenArray [ 'refreshToken' ] = $ token -> getRefreshToken ( ) ; $ tokenArray [ 'endOfLife' ] = $ token -> getExpires ( ) ; } return $ tokenArray ; }
docstring: Real token to array
docstring_tokens: Real token to array