File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1818 "php-http/discovery" : " ^1.0" ,
1919 "psr/http-client-implementation" : " ^1.0" ,
2020 "php-http/message-factory" : " ^1.0" ,
21- "psr/http-message-implementation" : " ^1.0" ,
22- "symfony/deprecation-contracts" : " ^2.5 || ^3.0"
21+ "psr/http-message-implementation" : " ^1.0"
2322 },
2423 "require-dev" : {
2524 "friendsofphp/php-cs-fixer" : " ^3.0" ,
Original file line number Diff line number Diff line change @@ -30,21 +30,22 @@ class HttpPluginClientBuilder
3030 private $ plugins = [];
3131
3232 /**
33- * @param ClientInterface|null $httpClient
3433 * @param RequestFactory|RequestFactoryInterface|null $requestFactory
3534 */
36- public function __construct (ClientInterface $ httpClient = null , $ requestFactory = null )
35+ public function __construct (? ClientInterface $ httpClient = null , $ requestFactory = null )
3736 {
3837 $ requestFactory = $ requestFactory ?: Psr17FactoryDiscovery::findRequestFactory ();
3938 if ($ requestFactory instanceof RequestFactory) {
40- trigger_deprecation (
39+ // Use same format as symfony/deprecation-contracts.
40+ @trigger_error (sprintf (
41+ 'Since %s %s: %s is deprecated, use %s instead. ' ,
4142 'private-packagist/api-client ' ,
4243 '1.35.0 ' ,
43- '' ,
4444 RequestFactory::class,
4545 RequestFactoryInterface::class
46- );
46+ ), \ E_USER_DEPRECATED ) ;
4747 } elseif (!$ requestFactory instanceof RequestFactoryInterface) {
48+ /** @var mixed $requestFactory value unknown; set to mixed, prevent PHPStan complaining about guard clauses */
4849 throw new \TypeError (sprintf (
4950 '%s::__construct(): Argument #2 ($requestFactory) must be of type %s|%s, %s given ' ,
5051 self ::class,
You can’t perform that action at this time.
0 commit comments