diff --git a/CHANGELOG.md b/CHANGELOG.md index bf14ebf..38df906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Change Log +## 1.19.3 - 2024-03-28 + +- [#261](https://github.com/php-http/discovery/pull/261) - explicitly mark nullable parameters as nullable (avoid deprecation in PHP 8.4) + ## 1.19.2 - 2023-11-30 -- [#253](https://github.com/php-http/discovery/pull/253) - Symfony 7 dropped the deprecated PHP-HTTP `HttpClient` interface from their HTTP client, do not discover the version 7 client when lookig for the old interface. +- [#253](https://github.com/php-http/discovery/pull/253) - Symfony 7 dropped the deprecated PHP-HTTP `HttpClient` interface from their HTTP client, do not discover the version 7 client when looking for the old interface. ## 1.19.1 - 2023-07-11 diff --git a/composer.json b/composer.json index 0d9194c..bd39db8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "symfony/phpunit-bridge": "^6.2" + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" }, "autoload": { "psr-4": { diff --git a/src/NotFoundException.php b/src/NotFoundException.php index d59dadb..559afac 100644 --- a/src/NotFoundException.php +++ b/src/NotFoundException.php @@ -2,6 +2,8 @@ namespace Http\Discovery; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; + /** * Thrown when a discovery does not find any matches. * @@ -9,6 +11,6 @@ * * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead. */ -final class NotFoundException extends \Http\Discovery\Exception\NotFoundException +final class NotFoundException extends RealNotFoundException { } diff --git a/src/Psr17FactoryDiscovery.php b/src/Psr17FactoryDiscovery.php index a73c641..e4348b4 100644 --- a/src/Psr17FactoryDiscovery.php +++ b/src/Psr17FactoryDiscovery.php @@ -3,6 +3,7 @@ namespace Http\Discovery; use Http\Discovery\Exception\DiscoveryFailedException; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ServerRequestFactoryInterface; @@ -19,7 +20,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery { private static function createException($type, Exception $e) { - return new \Http\Discovery\Exception\NotFoundException( + return new RealNotFoundException( 'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation', 0, $e @@ -29,7 +30,7 @@ private static function createException($type, Exception $e) /** * @return RequestFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findRequestFactory() { @@ -45,7 +46,7 @@ public static function findRequestFactory() /** * @return ResponseFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findResponseFactory() { @@ -61,7 +62,7 @@ public static function findResponseFactory() /** * @return ServerRequestFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findServerRequestFactory() { @@ -77,7 +78,7 @@ public static function findServerRequestFactory() /** * @return StreamFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findStreamFactory() { @@ -93,7 +94,7 @@ public static function findStreamFactory() /** * @return UploadedFileFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUploadedFileFactory() { @@ -109,7 +110,7 @@ public static function findUploadedFileFactory() /** * @return UriFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUriFactory() { @@ -125,7 +126,7 @@ public static function findUriFactory() /** * @return UriFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException * * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. */ diff --git a/src/Psr18ClientDiscovery.php b/src/Psr18ClientDiscovery.php index dfd2dd1..3f95418 100644 --- a/src/Psr18ClientDiscovery.php +++ b/src/Psr18ClientDiscovery.php @@ -3,6 +3,7 @@ namespace Http\Discovery; use Http\Discovery\Exception\DiscoveryFailedException; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; use Psr\Http\Client\ClientInterface; /** @@ -17,14 +18,14 @@ final class Psr18ClientDiscovery extends ClassDiscovery * * @return ClientInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function find() { try { $client = static::findOneByType(ClientInterface::class); } catch (DiscoveryFailedException $e) { - throw new \Http\Discovery\Exception\NotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e); + throw new RealNotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e); } return static::instantiateClass($client);