Skip to content

Commit c9f3c87

Browse files
authored
feature KnpLabs#948 Prepare 3.0 release and remove remaining deprecated code (acrobat)
This PR was merged into the 3.0.x-dev branch. Discussion ---------- Commits ------- dc00db7 Prepare 3.0 release and remove remaining deprecated code
2 parents e5a21a2 + dc00db7 commit c9f3c87

File tree

10 files changed

+26
-265
lines changed

10 files changed

+26
-265
lines changed

UPGRADE-3.0.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## UPGRADE from 2.x to 3.0
2+
3+
### General
4+
5+
* The `php-http/httplug` dependency requires is bumped to minimum ^2.1.
6+
* A client implementing `psr/http-client-implementation` is required.
7+
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)
8+
* All previous deprecated code in version 2 is removed.
9+
* The following classes are now final
10+
* `Github\HttpClient\Message\ResponseMediator`
11+
* `Github\HttpClient\Plugin\Authentication`
12+
* `Github\HttpClient\Plugin\GithubExceptionThrower`
13+
* `Github\HttpClient\Plugin\History`
14+
* `Github\HttpClient\Plugin\PathPrepend`
15+
16+
### Authetication methods
17+
18+
* `Github\Client::AUTH_URL_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead.
19+
* `Github\Client::AUTH_URL_CLIENT_ID` use `Github\Client::AUTH_CLIENT_ID` instead.
20+
* `Github\Client::AUTH_HTTP_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead.
21+
* `Github\Client::AUTH_HTTP_PASSWORD` use `Github\Client::AUTH_ACCESS_TOKEN` instead.

lib/Github/Api/Repo.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Github\Api\Repository\Actions\WorkflowJobs;
99
use Github\Api\Repository\Actions\WorkflowRuns;
1010
use Github\Api\Repository\Actions\Workflows;
11-
use Github\Api\Repository\Checks;
1211
use Github\Api\Repository\Checks\CheckRuns;
1312
use Github\Api\Repository\Checks\CheckSuites;
1413
use Github\Api\Repository\Collaborators;
@@ -323,21 +322,6 @@ public function commits()
323322
return new Commits($this->getClient());
324323
}
325324

326-
/**
327-
* Manage checks on a repository.
328-
*
329-
* @link https://developer.github.com/v3/checks/
330-
* @deprecated since 2.17 and will be removed in 3.0. Use the "checkRuns" or "checkSuites" api's instead.
331-
*
332-
* @return Checks
333-
*/
334-
public function checks()
335-
{
336-
@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);
337-
338-
return new Checks($this->getClient());
339-
}
340-
341325
/**
342326
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#check-runs
343327
*/

lib/Github/Api/Repository/Checks.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

lib/Github/HttpClient/Message/ResponseMediator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
use Github\Exception\ApiLimitExceedException;
66
use Psr\Http\Message\ResponseInterface;
77

8-
/**
9-
* @final since 2.19
10-
*/
11-
class ResponseMediator
8+
final class ResponseMediator
129
{
1310
/**
1411
* @param ResponseInterface $response

lib/Github/HttpClient/Plugin/Authentication.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
* Add authentication to the request.
1313
*
1414
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
15-
* @final since 2.19
1615
*/
17-
class Authentication implements Plugin
16+
final class Authentication implements Plugin
1817
{
1918
/**
2019
* @var string

lib/Github/HttpClient/Plugin/GithubExceptionThrower.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
/**
1818
* @author Joseph Bielawski <stloyd@gmail.com>
1919
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
20-
* @final since 2.19
2120
*/
22-
class GithubExceptionThrower implements Plugin
21+
final class GithubExceptionThrower implements Plugin
2322
{
2423
/**
2524
* @return Promise

lib/Github/HttpClient/Plugin/History.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
* A plugin to remember the last response.
1212
*
1313
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
14-
* @final since 2.19
1514
*/
16-
class History implements Journal
15+
final class History implements Journal
1716
{
1817
/**
1918
* @var ResponseInterface|null

lib/Github/HttpClient/Plugin/PathPrepend.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
* Prepend the URI with a string.
1111
*
1212
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
13-
* @final since 2.19
1413
*/
15-
class PathPrepend implements Plugin
14+
final class PathPrepend implements Plugin
1615
{
1716
/**
1817
* @var string

test/Github/Tests/Api/RepoTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -626,16 +626,6 @@ public function shouldTransferRepository()
626626
$this->assertEquals($expectedArray, $api->transfer('KnpLabs', 'php-github-api', 'github', [1234, 1235]));
627627
}
628628

629-
/**
630-
* @test
631-
*/
632-
public function shouldGetChecksApiObject()
633-
{
634-
$api = $this->getApiMock();
635-
636-
$this->assertInstanceOf(\Github\Api\Repository\Checks::class, $api->checks());
637-
}
638-
639629
/**
640630
* @return string
641631
*/

test/Github/Tests/Api/Repository/ChecksTest.php

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)