Skip to content

Commit 0220e72

Browse files
Merge branch '5.4' into 6.3
* 5.4: Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents d2fa225 + fee6db0 commit 0220e72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CacheInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface CacheInterface
4444
*
4545
* @throws InvalidArgumentException When $key is not valid or when $beta is negative
4646
*/
47-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed;
47+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed;
4848

4949
/**
5050
* Removes an item from the pool.

CacheTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class_exists(InvalidArgumentException::class);
2525
*/
2626
trait CacheTrait
2727
{
28-
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null): mixed
28+
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
2929
{
3030
return $this->doGet($this, $key, $callback, $beta, $metadata);
3131
}
@@ -35,7 +35,7 @@ public function delete(string $key): bool
3535
return $this->deleteItem($key);
3636
}
3737

38-
private function doGet(CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, array &$metadata = null, LoggerInterface $logger = null): mixed
38+
private function doGet(CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, ?array &$metadata = null, ?LoggerInterface $logger = null): mixed
3939
{
4040
if (0 > $beta ??= 1.0) {
4141
throw new class(sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta)) extends \InvalidArgumentException implements InvalidArgumentException { };

0 commit comments

Comments
 (0)