Skip to content

Commit 9fddac5

Browse files
Remove PHP Deprecated: Implicitly marking parameter as nullable. (#143)
Remove PHP Deprecated: Implicitly marking parameter as nullable. (#143)
1 parent 129f391 commit 9fddac5

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- New #132: Add interface `SerializerInterface` for data serialization, and `PhpSerializer` implementation (@Gerych1984)
66
- Chg #139: Make `normalize()` method static in `CacheKeyNormalizer` class (@terabytesoftw)
7+
- Enh #142: Minor refactoring: explicitly mark parameters as nullable (@terabytesoftw)
78

89
## 3.0.0 February 15, 2023
910

src/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getOrSet(
6363
mixed $key,
6464
callable $callable,
6565
DateInterval|int|null $ttl = null,
66-
Dependency $dependency = null,
66+
Dependency|null $dependency = null,
6767
float $beta = 1.0
6868
) {
6969
$key = CacheKeyNormalizer::normalize($key);

src/CacheInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getOrSet(
5959
mixed $key,
6060
callable $callable,
6161
DateInterval|int|null $ttl = null,
62-
Dependency $dependency = null,
62+
Dependency|null $dependency = null,
6363
float $beta = 1.0
6464
);
6565

src/Dependency/TagDependency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class TagDependency extends Dependency
4747
* For a single tag, you may specify it as a string.
4848
* @param int|null $ttl The TTL value of this item. null means infinity.
4949
*/
50-
public function __construct(array|string $tags, int $ttl = null)
50+
public function __construct(array|string $tags, int|null $ttl = null)
5151
{
5252
$this->tags = (array) $tags;
5353

src/Exception/CacheException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function __construct(
1313
private string $key,
1414
string $message = '',
1515
int $code = 0,
16-
Throwable $previous = null
16+
Throwable|null $previous = null
1717
) {
1818
parent::__construct($message, $code, $previous);
1919
}

0 commit comments

Comments
 (0)