Skip to content

Commit

Permalink
Add curl as dependancy, add getters for token, refresh, expiresIn
Browse files Browse the repository at this point in the history
  • Loading branch information
calum-jameson committed Sep 22, 2019
1 parent 315cc4b commit c301dfd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "A Bitbucket api interface",
"type": "library",
"require": {
"php": "^7.2"
"php": "^7.2",
"ext-curl": "*"
},
"require-dev": {
},
Expand Down
27 changes: 27 additions & 0 deletions src/Client/BitbucketApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,31 @@ protected function sendCurl($url, $curlOpts = [], $headers = [])
throw new BitbucketApiReturnUnknownException($response['http_status_code']);
}
}

/**
* Returns current Barer token.
* @return string|null
*/
public function getToken()
{
return $this->token;
}

/**
* Returns current refresh token.
* @return string|null
*/
public function getRefresh()
{
return $this->refresh;
}

/**
* Returns token expire time in seconds from time when token was initialised.
* @return int|null
*/
public function getExpiresIn()
{
return $this->expiresIn;
}
}

0 comments on commit c301dfd

Please sign in to comment.