Skip to content

Commit 306a3ab

Browse files
committed
Merge branch 'feature/maintenance' into develop
cleaned imports, fixed typos in docs.
2 parents d222f3c + eeddf73 commit 306a3ab

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

docs/Home.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,3 @@ A simple PHP wrapper for Bitbucket API.
3131
* [OAuth](users/oauth.md)
3232
* [Privileges](users/privileges.md)
3333
* [SSH Keys](users/ssh-keys.md)
34-
35-
### LEGEND:
36-
37-
* [-] Missing documentation.

docs/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Authentication
22

33
----
4-
Although you can access any public data without authentication, you need to authenticate before you can access certain features like (_but not limited to_) accesing data from a private repository, or give access to a repository.
4+
Although you can access any public data without authentication, you need to authenticate before you can access certain features like (_but not limited to_) accessing data from a private repository, or give access to a repository.
55
Bitbucket provides Basic and OAuth authentication.
66

77
### Basic authentication
@@ -67,4 +67,4 @@ $auth = new Bitbucket\API\Authentication\OAuth('oauth_version="1.0",oauth_nonce=
6767

6868
#### Related:
6969
* [Authentication @ BB Wiki](https://confluence.atlassian.com/display/BITBUCKET/Use+the+Bitbucket+REST+APIs#UsetheBitbucketRESTAPIs-Authentication)
70-
* [OAuth on Bitbucket @ BB Wiki](https://confluence.atlassian.com/display/BITBUCKET/OAuth+on+Bitbucket)
70+
* [OAuth on Bitbucket @ BB Wiki](https://confluence.atlassian.com/display/BITBUCKET/OAuth+on+Bitbucket)

lib/Bitbucket/API/Api.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
namespace Bitbucket\API;
1313

14-
use Buzz\Message;
15-
use Buzz\Client;
16-
use Bitbucket;
14+
use Buzz\Message\RequestInterface;
15+
use Buzz\Message\Response;
16+
use Buzz\Message\Request;
17+
use Buzz\Message\MessageInterface;
18+
use Buzz\Client\ClientInterface;
19+
use Buzz\Client\Curl;
1720

1821
/**
1922
* Api
@@ -51,7 +54,7 @@ class Api
5154

5255
/**
5356
* Transport object
54-
* @var Client\ClientInterface
57+
* @var ClientInterface
5558
*/
5659
protected $client;
5760

@@ -62,12 +65,12 @@ class Api
6265
protected $auth;
6366

6467
/**
65-
* @param Client\ClientInterface $client
68+
* @param ClientInterface $client
6669
* @return self
6770
*/
68-
public function __construct(Client\ClientInterface $client = null)
71+
public function __construct(ClientInterface $client = null)
6972
{
70-
$this->client = (is_null($client)) ? new Client\Curl : $client;
73+
$this->client = (is_null($client)) ? new Curl : $client;
7174

7275
return $this;
7376
}
@@ -88,10 +91,10 @@ public function setCredentials(Authentication\AuthenticationInterface $auth)
8891
* Add authorization header
8992
*
9093
* @access public
91-
* @param Message\RequestInterface $request
92-
* @return Message\RequestInterface
94+
* @param RequestInterface $request
95+
* @return RequestInterface
9396
*/
94-
public function authorize(Message\RequestInterface $request)
97+
public function authorize(RequestInterface $request)
9598
{
9699
if (!is_null($this->auth)) {
97100
$request = $this->auth->authenticate($request);
@@ -170,8 +173,8 @@ public function requestDelete($endpoint, $params = array(), $headers = array())
170173
*/
171174
protected function doRequest($method, $endpoint, array $params, array $headers)
172175
{
173-
$request = new Message\Request;
174-
$response = new Message\Response;
176+
$request = new Request;
177+
$response = new Response;
175178

176179
if (strtoupper($method) != 'POST') {
177180
$params['format'] = $this->format;
@@ -199,13 +202,13 @@ protected function doRequest($method, $endpoint, array $params, array $headers)
199202
* Process response received from API
200203
*
201204
* @access protected
202-
* @param Message\MessageInterface $response
205+
* @param MessageInterface $response
203206
* @return mixed
204207
*
205208
* @throws Authentication\Exception
206209
* @throws Exceptions\ForbiddenAccessException
207210
*/
208-
protected function processResponse(Message\MessageInterface $response)
211+
protected function processResponse(MessageInterface $response)
209212
{
210213
switch ($response->getStatusCode()) {
211214
case self::HTTP_RESPONSE_OK:
@@ -269,6 +272,3 @@ public function getFormat()
269272
return $this->format;
270273
}
271274
}
272-
273-
// @todo: poate sa mut exceptia asta in User namespace ?
274-
//class ForbiddenAccessException extends \Exception { }

0 commit comments

Comments
 (0)