From 36ccab9d642e482bc80506e39017e30bb9e631a9 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Wed, 10 Dec 2025 15:33:32 +0100 Subject: [PATCH] fix: use explicit nullable types for PHP 8.4 compatibility PHP 8.4 deprecates implicitly nullable parameter types. This changes: - Exchanger::__construct(): ?CacheInterface $cache = null - HttpService::__construct(): ?RequestFactoryInterface $requestFactory = null Fixes deprecation warnings when running on PHP 8.4. --- src/Exchanger.php | 2 +- src/Service/HttpService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exchanger.php b/src/Exchanger.php index aa06e07..42cf6ac 100755 --- a/src/Exchanger.php +++ b/src/Exchanger.php @@ -56,7 +56,7 @@ final class Exchanger implements ExchangeRateProviderContract * @param CacheInterface|null $cache * @param array $options */ - public function __construct(ExchangeRateServiceContract $service, CacheInterface $cache = null, array $options = []) + public function __construct(ExchangeRateServiceContract $service, ?CacheInterface $cache = null, array $options = []) { $this->service = $service; $this->cache = $cache; diff --git a/src/Service/HttpService.php b/src/Service/HttpService.php index c24daf0..d6a5d6c 100644 --- a/src/Service/HttpService.php +++ b/src/Service/HttpService.php @@ -47,7 +47,7 @@ abstract class HttpService extends Service * @param RequestFactoryInterface|null $requestFactory * @param array $options */ - public function __construct($httpClient = null, RequestFactoryInterface $requestFactory = null, array $options = []) + public function __construct($httpClient = null, ?RequestFactoryInterface $requestFactory = null, array $options = []) { if (null === $httpClient) { $httpClient = HttpClientDiscovery::find();