diff --git a/.travis.yml b/.travis.yml index 334c65d..94f7e52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ matrix: - php: 8.1 - php: 8.2 - php: 8.3 + - php: 8.4 cache: directories: 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/CentralBankOfRepublicTurkey.php b/src/Service/CentralBankOfRepublicTurkey.php index 1da8371..82125cd 100755 --- a/src/Service/CentralBankOfRepublicTurkey.php +++ b/src/Service/CentralBankOfRepublicTurkey.php @@ -70,7 +70,7 @@ public function supportQuery(ExchangeRateQuery $exchangeRateQuery): bool * * @throws UnsupportedCurrencyPairException */ - private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate + private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate { $currencyPair = $exchangeQuery->getCurrencyPair(); $content = $this->request($this->buildUrl($requestedDate)); @@ -97,7 +97,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac * * @return string */ - private function buildUrl(DateTimeInterface $requestedDate = null): string + private function buildUrl(?DateTimeInterface $requestedDate = null): string { if (null === $requestedDate) { $fileName = 'today'; diff --git a/src/Service/CentralBankOfRepublicUzbekistan.php b/src/Service/CentralBankOfRepublicUzbekistan.php index 7836ea7..470aef3 100644 --- a/src/Service/CentralBankOfRepublicUzbekistan.php +++ b/src/Service/CentralBankOfRepublicUzbekistan.php @@ -77,7 +77,7 @@ protected function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchan * @throws UnsupportedCurrencyPairException * @throws Exception */ - private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate + private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate { $currencyPair = $exchangeQuery->getCurrencyPair(); @@ -106,7 +106,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac * * @return string */ - private function buildUrl(DateTimeInterface $requestedDate = null): string + private function buildUrl(?DateTimeInterface $requestedDate = null): string { $date = ''; if (!is_null($requestedDate)) { 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(); diff --git a/src/Service/NationalBankOfGeorgia.php b/src/Service/NationalBankOfGeorgia.php index f4becdf..813920c 100644 --- a/src/Service/NationalBankOfGeorgia.php +++ b/src/Service/NationalBankOfGeorgia.php @@ -77,7 +77,7 @@ protected function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchan * @throws UnsupportedCurrencyPairException * @throws Exception */ - private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate + private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate { $currencyPair = $exchangeQuery->getCurrencyPair(); @@ -106,7 +106,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac * * @return string */ - private function buildUrl(DateTimeInterface $requestedDate = null): string + private function buildUrl(?DateTimeInterface $requestedDate = null): string { $date = ''; if (!is_null($requestedDate)) { diff --git a/src/Service/NationalBankOfRepublicBelarus.php b/src/Service/NationalBankOfRepublicBelarus.php index 6b16932..d171205 100644 --- a/src/Service/NationalBankOfRepublicBelarus.php +++ b/src/Service/NationalBankOfRepublicBelarus.php @@ -81,7 +81,7 @@ public function supportQuery(ExchangeRateQuery $exchangeQuery, bool $ignoreSuppo * * @return int|false */ - private static function detectPeriodicity(string $baseCurrency, \DateTimeInterface $date = null) + private static function detectPeriodicity(string $baseCurrency, ?\DateTimeInterface $date = null) { return array_reduce( @@ -115,7 +115,7 @@ static function ($periodicity, $entry) use ($date) { * * @return bool */ - private static function supportQuoteCurrency(string $quoteCurrency, \DateTimeInterface $date = null): bool + private static function supportQuoteCurrency(string $quoteCurrency, ?\DateTimeInterface $date = null): bool { if ($date) { $date = $date->format('Y-m-d'); @@ -167,7 +167,7 @@ public function getName(): string * @throws UnsupportedDateException * @throws UnsupportedExchangeQueryException */ - private function doCreateRate(ExchangeRateQuery $exchangeQuery, \DateTimeInterface $requestedDate = null): ExchangeRate + private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?\DateTimeInterface $requestedDate = null): ExchangeRate { $currencyPair = $exchangeQuery->getCurrencyPair(); $baseCurrency = $currencyPair->getBaseCurrency(); @@ -224,7 +224,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, \DateTimeInterfa * * @return string */ - private function buildUrl(string $baseCurrency, \DateTimeInterface $requestedDate = null): string + private function buildUrl(string $baseCurrency, ?\DateTimeInterface $requestedDate = null): string { $data = isset($requestedDate) ? ['ondate' => $requestedDate->format('Y-m-d')] : []; $data += ['periodicity' => (int) self::detectPeriodicity($baseCurrency, $requestedDate)];