Skip to content

Prepare 3.0 release and remove remaining deprecated code #948

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
Dec 21, 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
21 changes: 21 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## UPGRADE from 2.x to 3.0

### General

* The `php-http/httplug` dependency requires is bumped to minimum ^2.1.
* A client implementing `psr/http-client-implementation` is required.
To upgrade your application (default install) switch from guzzle 6 to guzzle 7 (or replace `php-http/guzzle6-adapter` with any `psr/http-client-implementation`), see the install instructions in the [README file](README.md)
* All previous deprecated code in version 2 is removed.
* The following classes are now final
* `Github\HttpClient\Message\ResponseMediator`
* `Github\HttpClient\Plugin\Authentication`
* `Github\HttpClient\Plugin\GithubExceptionThrower`
* `Github\HttpClient\Plugin\History`
* `Github\HttpClient\Plugin\PathPrepend`

### Authetication methods

* `Github\Client::AUTH_URL_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead.
* `Github\Client::AUTH_URL_CLIENT_ID` use `Github\Client::AUTH_CLIENT_ID` instead.
* `Github\Client::AUTH_HTTP_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead.
* `Github\Client::AUTH_HTTP_PASSWORD` use `Github\Client::AUTH_ACCESS_TOKEN` instead.
16 changes: 0 additions & 16 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Github\Api\Repository\Actions\WorkflowJobs;
use Github\Api\Repository\Actions\WorkflowRuns;
use Github\Api\Repository\Actions\Workflows;
use Github\Api\Repository\Checks;
use Github\Api\Repository\Checks\CheckRuns;
use Github\Api\Repository\Checks\CheckSuites;
use Github\Api\Repository\Collaborators;
Expand Down Expand Up @@ -323,21 +322,6 @@ public function commits()
return new Commits($this->getClient());
}

/**
* Manage checks on a repository.
*
* @link https://developer.github.com/v3/checks/
* @deprecated since 2.17 and will be removed in 3.0. Use the "checkRuns" or "checkSuites" api's instead.
*
* @return Checks
*/
public function checks()
{
@trigger_error(sprintf('The "%s" is deprecated since knp-labs/php-github-api 2.17 and will be removed in knp-labs/php-github-api 3.0. Use the "checkRuns" or "checkSuites" api\'s instead.', __METHOD__), E_USER_DEPRECATED);

return new Checks($this->getClient());
}

/**
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#check-runs
*/
Expand Down
107 changes: 0 additions & 107 deletions lib/Github/Api/Repository/Checks.php

This file was deleted.

5 changes: 1 addition & 4 deletions lib/Github/HttpClient/Message/ResponseMediator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
use Github\Exception\ApiLimitExceedException;
use Psr\Http\Message\ResponseInterface;

/**
* @final since 2.19
*/
class ResponseMediator
final class ResponseMediator
{
/**
* @param ResponseInterface $response
Expand Down
3 changes: 1 addition & 2 deletions lib/Github/HttpClient/Plugin/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
* Add authentication to the request.
*
* @author Tobias Nyholm <[email protected]>
* @final since 2.19
*/
class Authentication implements Plugin
final class Authentication implements Plugin
{
/**
* @var string
Expand Down
3 changes: 1 addition & 2 deletions lib/Github/HttpClient/Plugin/GithubExceptionThrower.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
/**
* @author Joseph Bielawski <[email protected]>
* @author Tobias Nyholm <[email protected]>
* @final since 2.19
*/
class GithubExceptionThrower implements Plugin
final class GithubExceptionThrower implements Plugin
{
/**
* @return Promise
Expand Down
3 changes: 1 addition & 2 deletions lib/Github/HttpClient/Plugin/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* A plugin to remember the last response.
*
* @author Tobias Nyholm <[email protected]>
* @final since 2.19
*/
class History implements Journal
final class History implements Journal
{
/**
* @var ResponseInterface|null
Expand Down
3 changes: 1 addition & 2 deletions lib/Github/HttpClient/Plugin/PathPrepend.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
* Prepend the URI with a string.
*
* @author Tobias Nyholm <[email protected]>
* @final since 2.19
*/
class PathPrepend implements Plugin
final class PathPrepend implements Plugin
{
/**
* @var string
Expand Down
10 changes: 0 additions & 10 deletions test/Github/Tests/Api/RepoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,16 +626,6 @@ public function shouldTransferRepository()
$this->assertEquals($expectedArray, $api->transfer('KnpLabs', 'php-github-api', 'github', [1234, 1235]));
}

/**
* @test
*/
public function shouldGetChecksApiObject()
{
$api = $this->getApiMock();

$this->assertInstanceOf(\Github\Api\Repository\Checks::class, $api->checks());
}

/**
* @return string
*/
Expand Down
120 changes: 0 additions & 120 deletions test/Github/Tests/Api/Repository/ChecksTest.php

This file was deleted.