fix: Deprecated: Return type of Bsr\Db\OdbcResultSet::current() should either be compatible with Iterator::current(): mixed
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user