Skip to content

Commit 7fbed2f

Browse files
authored
Merge pull request #262 from php-http/fix-build
fix build
2 parents 6b5f57f + 261b096 commit 7fbed2f

5 files changed

+21
-13
lines changed

Diff for: CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Change Log
22

3+
## 1.19.3 - 2024-03-28
4+
5+
- [#261](https://github.com/php-http/discovery/pull/261) - explicitly mark nullable parameters as nullable (avoid deprecation in PHP 8.4)
6+
37
## 1.19.2 - 2023-11-30
48

5-
- [#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.
9+
- [#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.
610

711
## 1.19.1 - 2023-07-11
812

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php-http/httplug": "^1.0 || ^2.0",
2929
"php-http/message-factory": "^1.0",
3030
"phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
31-
"symfony/phpunit-bridge": "^6.2"
31+
"symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
3232
},
3333
"autoload": {
3434
"psr-4": {

Diff for: src/NotFoundException.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
namespace Http\Discovery;
44

5+
use Http\Discovery\Exception\NotFoundException as RealNotFoundException;
6+
57
/**
68
* Thrown when a discovery does not find any matches.
79
*
810
* @author Márk Sági-Kazár <[email protected]>
911
*
1012
* @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead.
1113
*/
12-
final class NotFoundException extends \Http\Discovery\Exception\NotFoundException
14+
final class NotFoundException extends RealNotFoundException
1315
{
1416
}

Diff for: src/Psr17FactoryDiscovery.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Http\Discovery;
44

55
use Http\Discovery\Exception\DiscoveryFailedException;
6+
use Http\Discovery\Exception\NotFoundException as RealNotFoundException;
67
use Psr\Http\Message\RequestFactoryInterface;
78
use Psr\Http\Message\ResponseFactoryInterface;
89
use Psr\Http\Message\ServerRequestFactoryInterface;
@@ -19,7 +20,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery
1920
{
2021
private static function createException($type, Exception $e)
2122
{
22-
return new \Http\Discovery\Exception\NotFoundException(
23+
return new RealNotFoundException(
2324
'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation',
2425
0,
2526
$e
@@ -29,7 +30,7 @@ private static function createException($type, Exception $e)
2930
/**
3031
* @return RequestFactoryInterface
3132
*
32-
* @throws Exception\NotFoundException
33+
* @throws RealNotFoundException
3334
*/
3435
public static function findRequestFactory()
3536
{
@@ -45,7 +46,7 @@ public static function findRequestFactory()
4546
/**
4647
* @return ResponseFactoryInterface
4748
*
48-
* @throws Exception\NotFoundException
49+
* @throws RealNotFoundException
4950
*/
5051
public static function findResponseFactory()
5152
{
@@ -61,7 +62,7 @@ public static function findResponseFactory()
6162
/**
6263
* @return ServerRequestFactoryInterface
6364
*
64-
* @throws Exception\NotFoundException
65+
* @throws RealNotFoundException
6566
*/
6667
public static function findServerRequestFactory()
6768
{
@@ -77,7 +78,7 @@ public static function findServerRequestFactory()
7778
/**
7879
* @return StreamFactoryInterface
7980
*
80-
* @throws Exception\NotFoundException
81+
* @throws RealNotFoundException
8182
*/
8283
public static function findStreamFactory()
8384
{
@@ -93,7 +94,7 @@ public static function findStreamFactory()
9394
/**
9495
* @return UploadedFileFactoryInterface
9596
*
96-
* @throws Exception\NotFoundException
97+
* @throws RealNotFoundException
9798
*/
9899
public static function findUploadedFileFactory()
99100
{
@@ -109,7 +110,7 @@ public static function findUploadedFileFactory()
109110
/**
110111
* @return UriFactoryInterface
111112
*
112-
* @throws Exception\NotFoundException
113+
* @throws RealNotFoundException
113114
*/
114115
public static function findUriFactory()
115116
{
@@ -125,7 +126,7 @@ public static function findUriFactory()
125126
/**
126127
* @return UriFactoryInterface
127128
*
128-
* @throws Exception\NotFoundException
129+
* @throws RealNotFoundException
129130
*
130131
* @deprecated This will be removed in 2.0. Consider using the findUriFactory() method.
131132
*/

Diff for: src/Psr18ClientDiscovery.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Http\Discovery;
44

55
use Http\Discovery\Exception\DiscoveryFailedException;
6+
use Http\Discovery\Exception\NotFoundException as RealNotFoundException;
67
use Psr\Http\Client\ClientInterface;
78

89
/**
@@ -17,14 +18,14 @@ final class Psr18ClientDiscovery extends ClassDiscovery
1718
*
1819
* @return ClientInterface
1920
*
20-
* @throws Exception\NotFoundException
21+
* @throws RealNotFoundException
2122
*/
2223
public static function find()
2324
{
2425
try {
2526
$client = static::findOneByType(ClientInterface::class);
2627
} catch (DiscoveryFailedException $e) {
27-
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);
28+
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);
2829
}
2930

3031
return static::instantiateClass($client);

0 commit comments

Comments
 (0)