Skip to content

Commit 86ceb61

Browse files
authored
Merge pull request #126 from marmichalski/php84-implicit-null
fix: explicit nullable types
2 parents dffbbcd + 641e1c2 commit 86ceb61

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/Ganesha/GaneshaHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function request(string $method, string $url, array $options = []): Respo
7575
/**
7676
* {@inheritdoc}
7777
*/
78-
public function stream($responses, float $timeout = null): ResponseStreamInterface
78+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
7979
{
8080
return $this->client->stream($responses, $timeout);
8181
}

src/Ganesha/GuzzleMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class GuzzleMiddleware
4343

4444
public function __construct(
4545
Ganesha $ganesha,
46-
ServiceNameExtractorInterface $serviceNameExtractor = null,
47-
FailureDetectorInterface $failureDetector = null
46+
?ServiceNameExtractorInterface $serviceNameExtractor = null,
47+
?FailureDetectorInterface $failureDetector = null
4848
) {
4949
$this->ganesha = $ganesha;
5050
$this->serviceNameExtractor = $serviceNameExtractor ?: new ServiceNameExtractor();

src/Ganesha/Storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Storage
2828
public function __construct(
2929
AdapterInterface $adapter,
3030
StorageKeysInterface $storageKeys,
31-
callable $serviceNameDecorator = null
31+
?callable $serviceNameDecorator = null
3232
) {
3333
$this->adapter = $adapter;
3434
$this->serviceNameDecorator = $serviceNameDecorator;

src/Ganesha/Storage/Adapter/Apcu.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ class Apcu implements AdapterInterface, TumblingTimeWindowInterface
1919
/**
2020
* @param ApcuStore|null $apcuStore Backing store for testing (optional)
2121
*/
22-
public function __construct(ApcuStore $apcuStore = null)
22+
public function __construct(?ApcuStore $apcuStore = null)
2323
{
2424
$this->apcuStore = $apcuStore ?? new ApcuStore();
2525
}
2626

2727
/**
28-
* Returns returns whether the adapter supports counting strategy
28+
* Returns whether the adapter supports counting strategy
2929
*/
3030
public function supportCountStrategy(): bool
3131
{
3232
return true;
3333
}
3434

3535
/**
36-
* Returns returns whether the adapter supports rating strategy
36+
* Returns whether the adapter supports rating strategy
3737
*/
3838
public function supportRateStrategy(): bool
3939
{

src/Ganesha/Storage/AdapterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
interface AdapterInterface
99
{
1010
/**
11-
* Returns returns whether the adapter supports counting strategy
11+
* Returns whether the adapter supports counting strategy
1212
*/
1313
public function supportCountStrategy(): bool;
1414

1515
/**
16-
* Returns returns whether the adapter supports rating strategy
16+
* Returns whether the adapter supports rating strategy
1717
*/
1818
public function supportRateStrategy(): bool;
1919

tests/Ackintosh/Ganesha/Storage/Adapter/ApcuTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,8 @@ public function test_keyRegex(string $key, int $expectMatchResult)
667667
}
668668

669669
private function getApcu(
670-
ApcuStore $apcStore = null,
671-
StorageKeysInterface $storageKeys = null
670+
?ApcuStore $apcStore = null,
671+
?StorageKeysInterface $storageKeys = null
672672
): Apcu {
673673
$apc = new Apcu($apcStore);
674674
$context = new Ganesha\Context(
@@ -680,7 +680,7 @@ private function getApcu(
680680
return $apc;
681681
}
682682

683-
private function getConfiguration(StorageKeysInterface $storageKeys = null)
683+
private function getConfiguration(?StorageKeysInterface $storageKeys = null)
684684
{
685685
$configuration = $this->createMock(Configuration::class);
686686
$configuration->method('storageKeys')

0 commit comments

Comments
 (0)