We have detected an error in your notification set-up
(Event-ID dab39dc24f564ec7bd4628d1305fd03c).
Currently, we cannot inform you about inspection progress.
Please check that the user
557058:bca11929-8c2d-43f2-8a82-c5416880d395 still has access to your repository or
update the API account.
| 1 | <?php |
||
| 24 | class Client extends ClientListener implements ClientInterface |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $options = array( |
||
| 30 | 'base_url' => 'https://api.bitbucket.org', |
||
| 31 | 'api_version' => '1.0', |
||
| 32 | 'api_versions' => array('1.0', '2.0'), // supported versions |
||
| 33 | 'format' => 'json', |
||
| 34 | 'formats' => array('json', 'xml'), // supported response formats |
||
| 35 | 'user_agent' => 'bitbucket-api-php/1.0.0-dev (https://bitbucket.org/gentlero/bitbucket-api)', |
||
| 36 | 'timeout' => 10, |
||
| 37 | 'verify_peer' => true |
||
| 38 | ); |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @var BuzzClientInterface |
||
| 42 | */ |
||
| 43 | protected $client; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var RequestInterface |
||
| 47 | */ |
||
| 48 | private $lastRequest; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @var MessageInterface |
||
| 52 | */ |
||
| 53 | private $lastResponse; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @var MessageInterface |
||
| 57 | */ |
||
| 58 | protected $responseObj; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @var RequestInterface |
||
| 62 | */ |
||
| 63 | protected $requestObj; |
||
| 64 | |||
| 65 | 296 | public function __construct(array $options = array(), BuzzClientInterface $client = null) |
|
| 73 | |||
| 74 | /** |
||
| 75 | * {@inheritdoc} |
||
| 76 | */ |
||
| 77 | 7 | public function get($endpoint, $params = array(), $headers = array()) |
|
| 86 | |||
| 87 | /** |
||
| 88 | * {@inheritdoc} |
||
| 89 | */ |
||
| 90 | 1 | public function post($endpoint, $params = array(), $headers = array()) |
|
| 94 | |||
| 95 | /** |
||
| 96 | * {@inheritdoc} |
||
| 97 | */ |
||
| 98 | 1 | public function put($endpoint, $params = array(), $headers = array()) |
|
| 102 | |||
| 103 | /** |
||
| 104 | * {@inheritdoc} |
||
| 105 | */ |
||
| 106 | 2 | public function delete($endpoint, $params = array(), $headers = array()) |
|
| 110 | |||
| 111 | /** |
||
| 112 | * {@inheritdoc} |
||
| 113 | */ |
||
| 114 | 13 | public function request($endpoint, $params = array(), $method = 'GET', array $headers = array()) |
|
| 145 | |||
| 146 | /** |
||
| 147 | * @access public |
||
| 148 | * @return BuzzClientInterface |
||
| 149 | */ |
||
| 150 | 1 | public function getClient() |
|
| 154 | |||
| 155 | /** |
||
| 156 | * {@inheritdoc} |
||
| 157 | */ |
||
| 158 | 14 | public function getResponseFormat() |
|
| 162 | |||
| 163 | /** |
||
| 164 | * {@inheritdoc} |
||
| 165 | */ |
||
| 166 | 4 | public function setResponseFormat($format) |
|
| 176 | |||
| 177 | /** |
||
| 178 | * {@inheritdoc} |
||
| 179 | */ |
||
| 180 | 14 | public function getApiVersion() |
|
| 184 | |||
| 185 | /** |
||
| 186 | * {@inheritdoc} |
||
| 187 | */ |
||
| 188 | 91 | public function setApiVersion($version) |
|
| 198 | |||
| 199 | /** |
||
| 200 | * Check if specified API version is the one currently in use. |
||
| 201 | * |
||
| 202 | * @access public |
||
| 203 | * @param float $version |
||
| 204 | * @return bool |
||
| 205 | */ |
||
| 206 | 1 | public function isApiVersion($version) |
|
| 210 | |||
| 211 | /** |
||
| 212 | * {@inheritdoc} |
||
| 213 | */ |
||
| 214 | 13 | public function getApiBaseUrl() |
|
| 218 | |||
| 219 | /** |
||
| 220 | * @access public |
||
| 221 | * @return MessageInterface |
||
| 222 | */ |
||
| 223 | 5 | public function getLastRequest() |
|
| 227 | |||
| 228 | /** |
||
| 229 | * @access public |
||
| 230 | * @return RequestInterface |
||
| 231 | */ |
||
| 232 | 2 | public function getLastResponse() |
|
| 236 | |||
| 237 | /** |
||
| 238 | * @access public |
||
| 239 | * @param MessageInterface $response |
||
| 240 | * @return void |
||
| 241 | */ |
||
| 242 | public function setResponse(MessageInterface $response) |
||
| 246 | |||
| 247 | /** |
||
| 248 | * @access public |
||
| 249 | * @param RequestInterface $request |
||
| 250 | * @return void |
||
| 251 | */ |
||
| 252 | 1 | public function setRequest(RequestInterface $request) |
|
| 256 | |||
| 257 | /** |
||
| 258 | * @access protected |
||
| 259 | * @param string $method |
||
| 260 | * @param string $url |
||
| 261 | * @return RequestInterface |
||
| 262 | */ |
||
| 263 | 12 | protected function createRequest($method, $url) |
|
| 285 | |||
| 286 | /** |
||
| 287 | * Execute all available listeners. |
||
| 288 | * |
||
| 289 | * $when can be: preSend or postSend |
||
| 290 | * |
||
| 291 | * @access protected |
||
| 292 | * @param RequestInterface $request |
||
| 293 | * @param string $when When to execute the listener |
||
| 294 | * @param MessageInterface $response |
||
| 295 | */ |
||
| 296 | 13 | protected function executeListeners(RequestInterface $request, $when = 'preSend', MessageInterface $response = null) |
|
| 321 | } |
||
| 322 |