Skip to content

Commit 899e753

Browse files
authored
fix: Implicit conversion from float error (#215)
1 parent 8c29121 commit 899e753

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Types/AbstractCypherSequence.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ private function setupCache(): void
526526
{
527527
$generator = $this->getGenerator();
528528

529-
if (count($this->keyCache) !== 0 && count($this->cache) !== 0 && count($this->cache) % ($this->cacheLimit + 1) === 0) {
529+
$cacheLimit = $this->cacheLimit === PHP_INT_MAX ? PHP_INT_MAX : $this->cacheLimit + 1;
530+
531+
if (count($this->keyCache) !== 0 && count($this->cache) !== 0 && count($this->cache) % $cacheLimit === 0) {
530532
$this->cache = [array_key_last($this->cache) => $this->cache[array_key_last($this->cache)]];
531533
$this->keyCache = [$this->keyCache[array_key_last($this->keyCache)]];
532534
}

0 commit comments

Comments
 (0)