access_token = $access_token; $this->refresh_token = $refresh_token; $this->token_type = $token_type; // Enable negative expires_in; for testing... if ($expires_in === null) { return; } if ($expires_in < 0) { $expires_in = abs($expires_in); $di = new \DateInterval("PT{$expires_in}S"); $di->invert = $expires_in; } elseif ($expires_in >= 0) { $di = new \DateInterval("PT{$expires_in}S"); } $this->expires_at = (new \DateTime())->add($di)->format('Y-m-d H:i:s'); } /** * Set access token. * * @param string $access_token */ public function setAccessToken($access_token) { $this->access_token = $access_token; } /** * Get access token. * * @return string */ public function getAccessToken() { return $this->access_token; } /** * Set refresh token. * * @param string $refresh_token */ public function setRefreshToken($refresh_token) { $this->refresh_token = $refresh_token; } /** * Get refresh token. * * @return string|null */ public function getRefreshToken() { return $this->refresh_token; } /** * Set token type. * * @param string $token_type */ public function setTokenType($token_type) { $this->token_type = $token_type; } /** * Get token type. * * @return string */ public function getTokenType() { return $this->token_type; } /** * Set expires at. * * @param string $expires_at */ public function setExpiresAt($expires_at) { $this->expires_at = $expires_at; } /** * Get expires at. * * @return \DateTime */ public function getExpiresAt() { return $this->expires_at; } /** * Determine if a token is expired. * * @return bool */ public function isExpired() { if (is_null($this->expires_at)) { return false; } $expires_at = \DateTime::createFromFormat('Y-m-d H:i:s', $this->expires_at); $now = new \DateTime(); return $now > $expires_at; } } __halt_compiler();----SIGNATURE:----pxJTkXnFMbnUP9+nj/tGwL9LQK3P8IFijIQF2JRzTktzDH1CasqTSiQW1+rS524BJTyw6+pe6LhMFTKxAMg7uI5QgDtpHypx6yLQBqJsTduVMwjR9xbM0ZaBJz804DffOf/ImQum9OUhpxdhwBxgeA15xJq1y20GvVP0WFxrS7ULz9YL317JZARGJAFBxSh9hw/rg5zbuK0KEc/7XAoi1ILKJTtBxLGAXwpvmgL+c6iE1shVNuK1tzWhauuCoIvHQdmRYpOYr0cj4JxhLDTops+TANeQyzxrQo/U0ADunHfR4D4XpMVJp88pjEkx4sKZobCXl0elMviNd4EZ/4DPexPcqLMJliUEUyUrGeHOlTFQ8ulD6zpvluV43/3WnvjokHjJ/YKjN9NlZva+m+b6iOaVzUMkY24/R939jkrCQZT7p2h8jJ8XeTn+5OhvkrjnCERq3zRnte7MLf5ZQn6jnPkfcwXAHFT1ilZIsxGIBGszELOQgtd2IJHmtVpZkrNlLprd7QAPAC6Zr9UMo8eXnvSUexSj3PL+UPHsX6fMkjze75K7hLLA4ZhPSnNVPeiFk8Kx8ikm1QMBGGDUOxYvp9ZM8a7kiCO1xDFTNfJ/i9nQIFes5oASgfYzhgNDU7VF5wj1SqP8eFyDeSD8e37EZFivn0+2Cx4KMysNDIU3eNM=----ATTACHMENT:----NTY2NDUzNzczNzUzOTM4MiA2MzkyMDI1NTUxMzgyMjQ1IDMwNjkyNjU5NzgzODA4MTQ=