Skip to content

OAuth2AccessToken->getAccessTokenExpiresAt has wrong return data type #543

Open
@gmariani

Description

@gmariani
/**
 * Return the expiration date of Access Token
 * @return Date
 */
public function getAccessTokenExpiresAt(){
    if(!empty($this->accessTokenExpiresAt))
    {
      return $this->getDateFromSeconds($this->accessTokenExpiresAt);
    }else{
      throw new SdkException("The Expiration Time for OAuth 2 Access Token is not set.");
    }
}

It should be @return string, because getDateFromSeconds() just does :

/**
 * A helper function to convert Seconds to date
 * @param  int  $second
 * @return string
 */
private function getDateFromSeconds($seconds){
  return date('Y/m/d H:i:s', $seconds);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions