Skip to content

Commit 83e9b2c

Browse files
committed
Merge branch 'feature/php-84'
2 parents 76f2bc8 + 107f304 commit 83e9b2c

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ matrix:
1717
- php: 8.1
1818
- php: 8.2
1919
- php: 8.3
20+
- php: 8.4
2021

2122
cache:
2223
directories:

src/Exchanger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class Exchanger implements ExchangeRateProviderContract
5656
* @param CacheInterface|null $cache
5757
* @param array $options
5858
*/
59-
public function __construct(ExchangeRateServiceContract $service, CacheInterface $cache = null, array $options = [])
59+
public function __construct(ExchangeRateServiceContract $service, ?CacheInterface $cache = null, array $options = [])
6060
{
6161
$this->service = $service;
6262
$this->cache = $cache;

src/Service/CentralBankOfRepublicTurkey.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function supportQuery(ExchangeRateQuery $exchangeRateQuery): bool
7070
*
7171
* @throws UnsupportedCurrencyPairException
7272
*/
73-
private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate
73+
private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate
7474
{
7575
$currencyPair = $exchangeQuery->getCurrencyPair();
7676
$content = $this->request($this->buildUrl($requestedDate));
@@ -97,7 +97,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac
9797
*
9898
* @return string
9999
*/
100-
private function buildUrl(DateTimeInterface $requestedDate = null): string
100+
private function buildUrl(?DateTimeInterface $requestedDate = null): string
101101
{
102102
if (null === $requestedDate) {
103103
$fileName = 'today';

src/Service/CentralBankOfRepublicUzbekistan.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchan
7777
* @throws UnsupportedCurrencyPairException
7878
* @throws Exception
7979
*/
80-
private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate
80+
private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate
8181
{
8282
$currencyPair = $exchangeQuery->getCurrencyPair();
8383

@@ -106,7 +106,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac
106106
*
107107
* @return string
108108
*/
109-
private function buildUrl(DateTimeInterface $requestedDate = null): string
109+
private function buildUrl(?DateTimeInterface $requestedDate = null): string
110110
{
111111
$date = '';
112112
if (!is_null($requestedDate)) {

src/Service/HttpService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class HttpService extends Service
4949
* @param RequestFactoryInterface|null $requestFactory
5050
* @param array $options
5151
*/
52-
public function __construct($httpClient = null, RequestFactoryInterface $requestFactory = null, array $options = [])
52+
public function __construct($httpClient = null, ?RequestFactoryInterface $requestFactory = null, array $options = [])
5353
{
5454
if (null === $httpClient) {
5555
try {

src/Service/NationalBankOfGeorgia.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchan
7777
* @throws UnsupportedCurrencyPairException
7878
* @throws Exception
7979
*/
80-
private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterface $requestedDate = null): ExchangeRate
80+
private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?DateTimeInterface $requestedDate = null): ExchangeRate
8181
{
8282
$currencyPair = $exchangeQuery->getCurrencyPair();
8383

@@ -106,7 +106,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, DateTimeInterfac
106106
*
107107
* @return string
108108
*/
109-
private function buildUrl(DateTimeInterface $requestedDate = null): string
109+
private function buildUrl(?DateTimeInterface $requestedDate = null): string
110110
{
111111
$date = '';
112112
if (!is_null($requestedDate)) {

src/Service/NationalBankOfRepublicBelarus.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function supportQuery(ExchangeRateQuery $exchangeQuery, bool $ignoreSuppo
8181
*
8282
* @return int|false
8383
*/
84-
private static function detectPeriodicity(string $baseCurrency, \DateTimeInterface $date = null)
84+
private static function detectPeriodicity(string $baseCurrency, ?\DateTimeInterface $date = null)
8585
{
8686
return array_reduce(
8787

@@ -115,7 +115,7 @@ static function ($periodicity, $entry) use ($date) {
115115
*
116116
* @return bool
117117
*/
118-
private static function supportQuoteCurrency(string $quoteCurrency, \DateTimeInterface $date = null): bool
118+
private static function supportQuoteCurrency(string $quoteCurrency, ?\DateTimeInterface $date = null): bool
119119
{
120120
if ($date) {
121121
$date = $date->format('Y-m-d');
@@ -167,7 +167,7 @@ public function getName(): string
167167
* @throws UnsupportedDateException
168168
* @throws UnsupportedExchangeQueryException
169169
*/
170-
private function doCreateRate(ExchangeRateQuery $exchangeQuery, \DateTimeInterface $requestedDate = null): ExchangeRate
170+
private function doCreateRate(ExchangeRateQuery $exchangeQuery, ?\DateTimeInterface $requestedDate = null): ExchangeRate
171171
{
172172
$currencyPair = $exchangeQuery->getCurrencyPair();
173173
$baseCurrency = $currencyPair->getBaseCurrency();
@@ -224,7 +224,7 @@ private function doCreateRate(ExchangeRateQuery $exchangeQuery, \DateTimeInterfa
224224
*
225225
* @return string
226226
*/
227-
private function buildUrl(string $baseCurrency, \DateTimeInterface $requestedDate = null): string
227+
private function buildUrl(string $baseCurrency, ?\DateTimeInterface $requestedDate = null): string
228228
{
229229
$data = isset($requestedDate) ? ['ondate' => $requestedDate->format('Y-m-d')] : [];
230230
$data += ['periodicity' => (int) self::detectPeriodicity($baseCurrency, $requestedDate)];

0 commit comments

Comments
 (0)