Skip to content

Switch to PSR18 client implementation #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ Feel free to check out the [change log](CHANGELOG.md), [releases](https://github

This version requires [PHP](https://php.net) 7.2-7.4.

To get the latest version, simply require the project using [Composer](https://getcomposer.org). You will need to install any package that "provides" `php-http/client-implementation`. Pure PHP users will want something like:
To get the latest version, simply require the project using [Composer](https://getcomposer.org). You will need to install any package that "provides" `psr/http-client-implementation`. Pure PHP users will want something like:

```bash
$ composer require bitbucket/client php-http/guzzle6-adapter:^2.0
$ composer require bitbucket/client guzzlehttp/guzzle:^7.0.1
```

Laravel users will want something like:

```bash
$ composer require graham-campbell/bitbucket php-http/guzzle6-adapter:^2.0
$ composer require graham-campbell/bitbucket guzzlehttp/guzzle:^7.0.1
```

We are decoupled from any HTTP messaging client with help by [HTTPlug](http://httplug.io). You can visit [HTTPlug for library users](https://docs.php-http.org/en/latest/httplug/users.html) to get more information about installing HTTPlug related packages. [`graham-campbell/bitbucket`](https://github.com/GrahamCampbell/Laravel-Bitbucket) is also maintained by [Graham Campbell](https://github.com/GrahamCampbell).
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
],
"require": {
"php": "^7.2.5",
"psr/http-message": "^1.0",
"php-http/client-common": "^2.1",
"php-http/cache-plugin": "^1.7",
"php-http/discovery": "^1.7",
"php-http/httplug": "^2.1",
"php-http/multipart-stream-builder": "^1.1",
"psr/cache": "^1.0",
"php-http/httplug": "^1.1|^2.0",
"php-http/discovery": "^1.6",
"php-http/cache-plugin": "^1.6",
"php-http/client-implementation": "^1.0",
"php-http/client-common": "^1.9|^2.0",
"php-http/multipart-stream-builder": "^1.0"
"psr/http-client-implementation": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"graham-campbell/analyzer": "^2.4",
"phpunit/phpunit": "^8.5|^9.0",
"php-http/guzzle6-adapter": "^1.1|^2.0"
"php-http/guzzle6-adapter": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 5 additions & 5 deletions src/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Bitbucket\Exception\InvalidArgumentException;
use Bitbucket\HttpClient\Message\ResponseMediator;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract bitbucket api class.
Expand All @@ -35,7 +35,7 @@ abstract class AbstractApi implements ApiInterface
/**
* The http methods client.
*
* @var \Http\Client\Common\HttpMethodsClient
* @var \Http\Client\Common\HttpMethodsClientInterface
*/
private $client;

Expand All @@ -49,11 +49,11 @@ abstract class AbstractApi implements ApiInterface
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param \Http\Client\Common\HttpMethodsClientInterface $client
*
* @return void
*/
public function __construct(HttpMethodsClient $client)
public function __construct(HttpMethodsClientInterface $client)
{
$this->client = $client;
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public function setPerPage(int $perPage = null)
/**
* Get the http methods client.
*
* @return \Http\Client\Common\HttpMethodsClient
* @return \Http\Client\Common\HttpMethodsClientInterface
*/
protected function getHttpClient()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Addon/Linkers/AbstractLinkersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Addon\Linkers;

use Bitbucket\Api\Addon\AbstractAddonApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract linkers api class.
Expand All @@ -33,10 +33,10 @@ abstract class AbstractLinkersApi extends AbstractAddonApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $linker
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $linker
*/
public function __construct(HttpMethodsClient $client, string $linker)
public function __construct(HttpMethodsClientInterface $client, string $linker)
{
parent::__construct($client);
$this->linker = $linker;
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Addon/Users/AbstractUsersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Addon\Users;

use Bitbucket\Api\Addon\AbstractAddonApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract users api class.
Expand All @@ -33,10 +33,10 @@ abstract class AbstractUsersApi extends AbstractAddonApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
*/
public function __construct(HttpMethodsClient $client, string $username)
public function __construct(HttpMethodsClientInterface $client, string $username)
{
parent::__construct($client);
$this->username = $username;
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Repositories/AbstractRepositoriesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories;

use Bitbucket\Api\AbstractApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract repository api class.
Expand All @@ -33,10 +33,10 @@ abstract class AbstractRepositoriesApi extends AbstractApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
*/
public function __construct(HttpMethodsClient $client, string $username)
public function __construct(HttpMethodsClientInterface $client, string $username)
{
parent::__construct($client);
$this->username = $username;
Expand Down
10 changes: 5 additions & 5 deletions src/Api/Repositories/Users/AbstractUsersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users;

use Bitbucket\Api\Repositories\AbstractRepositoriesApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract users api class.
Expand All @@ -33,11 +33,11 @@ abstract class AbstractUsersApi extends AbstractRepositoriesApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo)
{
parent::__construct($client, $username);
$this->repo = $repo;
Expand Down
12 changes: 6 additions & 6 deletions src/Api/Repositories/Users/Commit/AbstractCommitApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users\Commit;

use Bitbucket\Api\Repositories\Users\AbstractUsersApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract commit api class.
Expand All @@ -33,12 +33,12 @@ abstract class AbstractCommitApi extends AbstractUsersApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param string $commit
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
* @param string $commit
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo, string $commit)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo, string $commit)
{
parent::__construct($client, $username, $repo);
$this->commit = $commit;
Expand Down
12 changes: 6 additions & 6 deletions src/Api/Repositories/Users/Issues/AbstractIssuesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users\Issues;

use Bitbucket\Api\Repositories\Users\AbstractUsersApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract issues api class.
Expand All @@ -33,12 +33,12 @@ abstract class AbstractIssuesApi extends AbstractUsersApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param string $issue
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
* @param string $issue
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo, string $issue)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo, string $issue)
{
parent::__construct($client, $username, $repo);
$this->issue = $issue;
Expand Down
12 changes: 6 additions & 6 deletions src/Api/Repositories/Users/Pipelines/AbstractPipelinesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users\Pipelines;

use Bitbucket\Api\Repositories\Users\AbstractUsersApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract pipelines api class.
Expand All @@ -33,12 +33,12 @@ abstract class AbstractPipelinesApi extends AbstractUsersApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param string $pipeline
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
* @param string $pipeline
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo, string $pipeline)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo, string $pipeline)
{
parent::__construct($client, $username, $repo);
$this->pipeline = $pipeline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users\PipelinesConfig\Schedules;

use Bitbucket\Api\Repositories\Users\PipelinesConfig\AbstractPipelinesConfigApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract schedules api class.
Expand All @@ -33,12 +33,12 @@ abstract class AbstractSchedulesApi extends AbstractPipelinesConfigApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param string $schedule
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
* @param string $schedule
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo, string $schedule)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo, string $schedule)
{
parent::__construct($client, $username, $repo);
$this->schedule = $schedule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Repositories\Users\PullRequests;

use Bitbucket\Api\Repositories\Users\AbstractUsersApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract pull requests api class.
Expand All @@ -33,12 +33,12 @@ abstract class AbstractPullRequestsApi extends AbstractUsersApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $repo
* @param string $pr
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $repo
* @param string $pr
*/
public function __construct(HttpMethodsClient $client, string $username, string $repo, string $pr)
public function __construct(HttpMethodsClientInterface $client, string $username, string $repo, string $pr)
{
parent::__construct($client, $username, $repo);
$this->pr = $pr;
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Snippets/AbstractSnippetsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Snippets;

use Bitbucket\Api\AbstractApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract snippets api class.
Expand All @@ -33,10 +33,10 @@ abstract class AbstractSnippetsApi extends AbstractApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
*/
public function __construct(HttpMethodsClient $client, string $username)
public function __construct(HttpMethodsClientInterface $client, string $username)
{
parent::__construct($client);
$this->username = $username;
Expand Down
10 changes: 5 additions & 5 deletions src/Api/Snippets/Users/AbstractUsersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bitbucket\Api\Snippets\Users;

use Bitbucket\Api\Snippets\AbstractSnippetsApi;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The abstract users api class.
Expand All @@ -33,11 +33,11 @@ abstract class AbstractUsersApi extends AbstractSnippetsApi
/**
* Create a new api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param string $snippet
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
* @param string $snippet
*/
public function __construct(HttpMethodsClient $client, string $username, string $snippet)
public function __construct(HttpMethodsClientInterface $client, string $username, string $snippet)
{
parent::__construct($client, $username);
$this->snippet = $snippet;
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Bitbucket\Api\Teams\PipelinesConfig;
use Bitbucket\Api\Teams\Projects;
use Bitbucket\Api\Teams\Repositories as TeamsRepositories;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;

/**
* The teams api class.
Expand All @@ -40,10 +40,10 @@ class Teams extends AbstractApi
/**
* Create a new teams api instance.
*
* @param \Http\Client\Common\HttpMethodsClient $client
* @param string $username
* @param \Http\Client\Common\HttpMethodsClientInterface $client
* @param string $username
*/
public function __construct(HttpMethodsClient $client, string $username)
public function __construct(HttpMethodsClientInterface $client, string $username)
{
parent::__construct($client);
$this->username = $username;
Expand Down
Loading