From 86b781857f6ff3b63b879140bb49de447296e243 Mon Sep 17 00:00:00 2001 From: Guillermo Pages Date: Fri, 24 Nov 2023 15:28:28 +0100 Subject: [PATCH] fix: Deprecated: Return type of Bsr\Db\OdbcResultSet::current() should either be compatible with Iterator::current(): mixed --- src/Db/OdbcResultSet.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Db/OdbcResultSet.php b/src/Db/OdbcResultSet.php index 5530321..a622632 100644 --- a/src/Db/OdbcResultSet.php +++ b/src/Db/OdbcResultSet.php @@ -81,8 +81,9 @@ class OdbcResultSet implements \Iterator, \ArrayAccess, \Countable } // Iterator - /** - * @return bool|array + /** + * Return the current element + * @return mixed */ public function current() { @@ -90,32 +91,37 @@ class OdbcResultSet implements \Iterator, \ArrayAccess, \Countable } /** - * @return int + * Return the key of the current element + * @return mixed */ - public function key() + public function key(): mixed { return $this->cursor_index; } /** - * @return array|bool + * Move forward to next element + * @return void */ - public function next() + public function next(): void { - $current = $this->current(); ++$this->cursor_index; - return $current; } - public function rewind() + /** + * Rewind the Iterator to the first element + * @return void + */ + public function rewind(): void { $this->cursor_index = 0; } /** + * Checks if current position is valid * @return bool */ - public function valid() + public function valid(): bool { return $this->offsetExists($this->cursor_index); }