Skip to content

Commit

Permalink
Merge branch 'master' into fork/marmichalski/rejected-ex-srv
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Feb 8, 2025
2 parents e297a35 + 86ceb61 commit 918ff78
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
composer-opts:
- ""
- --prefer-lowest --prefer-stable
# We have a dependency issue under the specific condition involving PHP 8.4 and `--prefer-lowest --prefer-stable`,
# so we will allow failure for the condition temporarily.
# Dropping the support for EOLed PHP version might resolve this.
continue-on-error: ${{ matrix.php-version == '8.4' && matrix.composer-opts == '--prefer-lowest --prefer-stable' }}
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5.10",
"symfony/http-client": "^5.3|^6.0",
"symfony/http-client": "^5.3.12|^6.0",
"symfony/yaml": "^3.0|^4.0|^5.0|^6.0",
"php-vcr/php-vcr": "^1.4.5",
"php-vcr/phpunit-testlistener-vcr": "dev-php8 as 3.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/Ganesha/GaneshaHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function request(string $method, string $url, array $options = []): Respo
/**
* {@inheritdoc}
*/
public function stream($responses, float $timeout = null): ResponseStreamInterface
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
{
return $this->client->stream($responses, $timeout);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Ganesha/GuzzleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class GuzzleMiddleware

public function __construct(
Ganesha $ganesha,
ServiceNameExtractorInterface $serviceNameExtractor = null,
FailureDetectorInterface $failureDetector = null
?ServiceNameExtractorInterface $serviceNameExtractor = null,
?FailureDetectorInterface $failureDetector = null
) {
$this->ganesha = $ganesha;
$this->serviceNameExtractor = $serviceNameExtractor ?: new ServiceNameExtractor();
Expand Down
2 changes: 1 addition & 1 deletion src/Ganesha/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Storage
public function __construct(
AdapterInterface $adapter,
StorageKeysInterface $storageKeys,
callable $serviceNameDecorator = null
?callable $serviceNameDecorator = null
) {
$this->adapter = $adapter;
$this->serviceNameDecorator = $serviceNameDecorator;
Expand Down
6 changes: 3 additions & 3 deletions src/Ganesha/Storage/Adapter/Apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ class Apcu implements AdapterInterface, TumblingTimeWindowInterface
/**
* @param ApcuStore|null $apcuStore Backing store for testing (optional)
*/
public function __construct(ApcuStore $apcuStore = null)
public function __construct(?ApcuStore $apcuStore = null)
{
$this->apcuStore = $apcuStore ?? new ApcuStore();
}

/**
* Returns returns whether the adapter supports counting strategy
* Returns whether the adapter supports counting strategy
*/
public function supportCountStrategy(): bool
{
return true;
}

/**
* Returns returns whether the adapter supports rating strategy
* Returns whether the adapter supports rating strategy
*/
public function supportRateStrategy(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Ganesha/Storage/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
interface AdapterInterface
{
/**
* Returns returns whether the adapter supports counting strategy
* Returns whether the adapter supports counting strategy
*/
public function supportCountStrategy(): bool;

/**
* Returns returns whether the adapter supports rating strategy
* Returns whether the adapter supports rating strategy
*/
public function supportRateStrategy(): bool;

Expand Down
6 changes: 3 additions & 3 deletions tests/Ackintosh/Ganesha/Storage/Adapter/ApcuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,8 @@ public function test_keyRegex(string $key, int $expectMatchResult)
}

private function getApcu(
ApcuStore $apcStore = null,
StorageKeysInterface $storageKeys = null
?ApcuStore $apcStore = null,
?StorageKeysInterface $storageKeys = null
): Apcu {
$apc = new Apcu($apcStore);
$context = new Ganesha\Context(
Expand All @@ -680,7 +680,7 @@ private function getApcu(
return $apc;
}

private function getConfiguration(StorageKeysInterface $storageKeys = null)
private function getConfiguration(?StorageKeysInterface $storageKeys = null)
{
$configuration = $this->createMock(Configuration::class);
$configuration->method('storageKeys')
Expand Down

0 comments on commit 918ff78

Please sign in to comment.