diff --git a/CHANGELOG.md b/CHANGELOG.md index d3794ba..ddbaa43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.3] - 2025-12-08 + +- Fixed BC breaks accidentally introduced in 3.1.2 ## [3.1.2] - 2025-12-08 diff --git a/src/HttpAsyncClientTest.php b/src/HttpAsyncClientTest.php index 1301ff6..a0092fa 100644 --- a/src/HttpAsyncClientTest.php +++ b/src/HttpAsyncClientTest.php @@ -35,8 +35,8 @@ public function testSuccessiveCallMustUseResponseInterface() { $request = self::$messageFactory->createRequest( 'GET', - self::getUri(), - self::$defaultHeaders + $this->getUri(), + $this->defaultHeaders ); $promise = $this->httpAsyncClient->sendAsyncRequest($request); @@ -63,7 +63,7 @@ public function testSuccessiveInvalidCallMustUseException() $request = self::$messageFactory->createRequest( 'GET', $this->getInvalidUri(), - self::$defaultHeaders + $this->defaultHeaders ); $promise = $this->httpAsyncClient->sendAsyncRequest($request); @@ -136,7 +136,7 @@ public function testSendAsyncWithInvalidUri() $request = self::$messageFactory->createRequest( 'GET', $this->getInvalidUri(), - self::$defaultHeaders + $this->defaultHeaders ); $exception = null; diff --git a/src/HttpBaseTest.php b/src/HttpBaseTest.php index e735126..e23bc4f 100644 --- a/src/HttpBaseTest.php +++ b/src/HttpBaseTest.php @@ -34,7 +34,7 @@ abstract class HttpBaseTest extends TestCase /** * @var array */ - protected static $defaultHeaders = [ + protected $defaultHeaders = [ 'Connection' => 'close', 'User-Agent' => 'PHP HTTP Adapter', 'Content-Length' => '0', @@ -59,13 +59,13 @@ public static function tearDownAfterClass(): void } } - public static function requestProvider(): array + public function requestProvider(): array { $sets = [ - 'methods' => self::getMethods(), - 'uris' => [self::getUri()], - 'headers' => self::getHeaders(), - 'body' => self::getBodies(), + 'methods' => $this->getMethods(), + 'uris' => [$this->getUri()], + 'headers' => $this->getHeaders(), + 'body' => $this->getBodies(), ]; $cartesianProduct = new CartesianProduct($sets); @@ -82,13 +82,13 @@ public static function requestProvider(): array }); } - public static function requestWithOutcomeProvider(): array + public function requestWithOutcomeProvider(): array { $sets = [ - 'urisAndOutcomes' => self::getUrisAndOutcomes(), - 'protocolVersions' => self::getProtocolVersions(), - 'headers' => self::getHeaders(), - 'body' => self::getBodies(), + 'urisAndOutcomes' => $this->getUrisAndOutcomes(), + 'protocolVersions' => $this->getProtocolVersions(), + 'headers' => $this->getHeaders(), + 'body' => $this->getBodies(), ]; $cartesianProduct = new CartesianProduct($sets); @@ -96,7 +96,7 @@ public static function requestWithOutcomeProvider(): array return $cartesianProduct->compute(); } - private static function getMethods(): array + private function getMethods(): array { return [ 'GET', @@ -114,7 +114,7 @@ private static function getMethods(): array * * @return string|null */ - protected static function getUri(array $query = []) + protected function getUri(array $query = []) { return !empty($query) ? PHPUnitUtility::getUri().'?'.http_build_query($query, '', '&') @@ -132,25 +132,25 @@ protected function getInvalidUri() /** * @return array */ - private static function getUrisAndOutcomes() + private function getUrisAndOutcomes() { return [ [ - self::getUri(['client_error' => true]), + $this->getUri(['client_error' => true]), [ 'statusCode' => 400, 'reasonPhrase' => 'Bad Request', ], ], [ - self::getUri(['server_error' => true]), + $this->getUri(['server_error' => true]), [ 'statusCode' => 500, 'reasonPhrase' => 'Internal Server Error', ], ], [ - self::getUri(['redirect' => true]), + $this->getUri(['redirect' => true]), [ 'statusCode' => 302, 'reasonPhrase' => 'Found', @@ -163,7 +163,7 @@ private static function getUrisAndOutcomes() /** * @return array */ - private static function getProtocolVersions() + private function getProtocolVersions() { return ['1.1', '1.0']; } @@ -171,14 +171,14 @@ private static function getProtocolVersions() /** * @return string[] */ - private static function getHeaders() + private function getHeaders() { - $headers = self::$defaultHeaders; + $headers = $this->defaultHeaders; $headers['Accept-Charset'] = 'utf-8'; $headers['Accept-Language'] = 'en'; return [ - self::$defaultHeaders, + $this->defaultHeaders, $headers, ]; } @@ -186,18 +186,18 @@ private static function getHeaders() /** * @return array */ - private static function getBodies() + private function getBodies() { return [ null, - http_build_query(self::getData(), '', '&'), + http_build_query($this->getData(), '', '&'), ]; } /** * @return array */ - private static function getData() + private function getData() { return ['param1' => 'foo', 'param2' => ['bar', ['baz']]]; } diff --git a/src/HttpClientTest.php b/src/HttpClientTest.php index 884a319..c1bd1a6 100644 --- a/src/HttpClientTest.php +++ b/src/HttpClientTest.php @@ -107,7 +107,7 @@ public function testSendWithInvalidUri() $request = self::$messageFactory->createRequest( 'GET', $this->getInvalidUri(), - self::$defaultHeaders + $this->defaultHeaders ); $this->expectException(NetworkExceptionInterface::class);