MDL-73424 general: Internal methods must have same type as parent

Otherwise the error is thrown in PHP8.1
This commit is contained in:
Marina Glancy
2022-10-10 16:46:13 +02:00
parent cc4fec275f
commit 41b93bd7e5
42 changed files with 154 additions and 98 deletions
@@ -67,6 +67,7 @@ class skip_future_documents_iterator implements \Iterator {
}
}
#[\ReturnTypeWillChange]
public function current() {
if (!$this->gotcurrent) {
$this->currentdoc = $this->parent->current();
@@ -75,16 +76,17 @@ class skip_future_documents_iterator implements \Iterator {
return $this->currentdoc;
}
public function next() {
public function next(): void {
$this->parent->next();
$this->gotcurrent = false;
}
#[\ReturnTypeWillChange]
public function key() {
return $this->parent->key();
}
public function valid() {
public function valid(): bool {
// Check that the parent is valid.
if (!$this->parent->valid()) {
return false;
@@ -99,7 +101,7 @@ class skip_future_documents_iterator implements \Iterator {
}
}
public function rewind() {
public function rewind(): void {
$this->parent->rewind();
$this->gotcurrent = false;
}