Skip to content

Commit

Permalink
Fix upstream deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Sep 23, 2024
1 parent 1b63598 commit 6d145f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: Run phpunit
run: vendor/bin/phpunit --verbose
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=0'

phpstan:
name: PHPStan
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"require-dev": {
"symfony/cache": "^5.1.8",
"guzzlehttp/psr7": "^1.7",
"guzzlehttp/psr7": "^2.7",
"http-interop/http-factory-guzzle": "^1.0",
"guzzlehttp/guzzle": "^7.2",
"php-http/mock-client": "^1.4.1",
Expand Down
3 changes: 2 additions & 1 deletion test/Github/Tests/Api/AbstractApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Github\Api\AbstractApi;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Utils;
use Http\Client\Common\HttpMethodsClientInterface;

class AbstractApiTest extends TestCase
Expand Down Expand Up @@ -232,7 +233,7 @@ private function getPSR7Response($expectedArray)
return new Response(
200,
['Content-Type' => 'application/json'],
\GuzzleHttp\Psr7\stream_for(json_encode($expectedArray))
Utils::streamFor(json_encode($expectedArray))
);
}
}
3 changes: 2 additions & 1 deletion test/Github/Tests/Functional/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Github\AuthMethod;
use Github\Client;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Utils;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

/**
Expand Down Expand Up @@ -61,7 +62,7 @@ private function getCurrentUserResponse($username)
'Content-Type' => 'application/json',
];

$body = \GuzzleHttp\Psr7\stream_for(json_encode([
$body = Utils::streamFor(json_encode([
'login' => $username,
]));

Expand Down
7 changes: 4 additions & 3 deletions test/Github/Tests/HttpClient/Message/ResponseMediatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Github\HttpClient\Message\ResponseMediator;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Utils;

/**
* @author Tobias Nyholm <[email protected]>
Expand All @@ -16,7 +17,7 @@ public function testGetContent()
$response = new Response(
200,
['Content-Type' => 'application/json'],
\GuzzleHttp\Psr7\stream_for(json_encode($body))
Utils::streamFor(json_encode($body))
);

$this->assertEquals($body, ResponseMediator::getContent($response));
Expand All @@ -31,7 +32,7 @@ public function testGetContentNotJson()
$response = new Response(
200,
[],
\GuzzleHttp\Psr7\stream_for($body)
Utils::streamFor($body)
);

$this->assertEquals($body, ResponseMediator::getContent($response));
Expand All @@ -46,7 +47,7 @@ public function testGetContentInvalidJson()
$response = new Response(
200,
['Content-Type' => 'application/json'],
\GuzzleHttp\Psr7\stream_for($body)
Utils::streamFor($body)
);

$this->assertEquals($body, ResponseMediator::getContent($response));
Expand Down
7 changes: 4 additions & 3 deletions test/Github/Tests/Mock/PaginatedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Github\Tests\Mock;

use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Utils;

/**
* @author Tobias Nyholm <[email protected]>
Expand All @@ -18,10 +19,10 @@ public function __construct($loopCount, array $content = [])
$this->loopCount = $loopCount;
$this->content = $content;

parent::__construct(200, ['Content-Type' => 'application/json'], \GuzzleHttp\Psr7\stream_for(json_encode($content)));
parent::__construct(200, ['Content-Type' => 'application/json'], Utils::streamFor(json_encode($content)));
}

public function getHeader($header)
public function getHeader($header): array
{
if ($header === 'Link') {
if ($this->loopCount > 1) {
Expand All @@ -38,7 +39,7 @@ public function getHeader($header)
return parent::getHeader($header);
}

public function hasHeader($header)
public function hasHeader($header): bool
{
if ($header === 'Link') {
return true;
Expand Down

0 comments on commit 6d145f5

Please sign in to comment.