Skip to content

Commit 10a4b43

Browse files
committed
fix: make LimitedMaxHeap compatible with PHP 8.4
1 parent b4a8664 commit 10a4b43

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
},
173173
"require-dev": {
174174
"ably/ably-php": "^1.0",
175-
"fakerphp/faker": "^2.0",
175+
"fakerphp/faker": "^1.24.1",
176176
"filp/whoops": "^2.15",
177177
"friendsofphp/php-cs-fixer": "^3.57.2",
178178
"hyperf/devtool": "~3.1.0",
@@ -184,7 +184,7 @@
184184
"league/flysystem-google-cloud-storage": "^3.0",
185185
"league/flysystem-path-prefixing": "^3.3",
186186
"league/flysystem-read-only": "^3.3",
187-
"mockery/mockery": "^1.5.1",
187+
"mockery/mockery": "1.6.x-dev",
188188
"nunomaduro/collision": "^8.5",
189189
"pda/pheanstalk": "v5.0.9",
190190
"phpstan/phpstan": "^1.11.5",

src/cache/src/LimitedMaxHeap.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ public function __construct(protected int $limit)
1212
{
1313
}
1414

15-
public function insert(mixed $value): bool
15+
public function insert(mixed $value): true
1616
{
1717
if ($this->count() < $this->limit) {
1818
return parent::insert($value);
1919
}
2020

2121
if ($this->compare($value, $this->top()) < 0) {
2222
$this->extract();
23-
24-
return parent::insert($value);
2523
}
2624

27-
return false;
25+
return parent::insert($value);
2826
}
2927
}

0 commit comments

Comments
 (0)