fix: Deprecated: Return type of Bsr\Db\OdbcResultSet::current() should either be compatible with Iterator::current(): mixed

This commit is contained in:
Guillermo Pages
2023-11-24 15:28:28 +01:00
parent a07065ab8c
commit 86b781857f

View File

@@ -82,7 +82,8 @@ 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);
}