Skip to content

Commit

Permalink
Bugfix for psalm type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
cracksalad committed Nov 21, 2023
1 parent ee0f258 commit 9e003c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LargeArrayBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ public function current(): mixed {
/**
* {@inheritDoc}
* @see \Iterator::key()
* @psalm-return int<-1, max>
* @psalm-return int<0, max>
* @psalm-mutation-free
*/
public function key(): int {
return $this->index - 1;
return max(0, $this->index - 1);
}

public function valid(): bool {
Expand Down

0 comments on commit 9e003c8

Please sign in to comment.