mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge pull request #338 from creative-commoners/pulls/4/ReturnTypeWillChange
API Strongly type iterator classes and remove ReturnTypeWillChange annotation
This commit is contained in:
commit
d73868f8c0
@ -32,29 +32,26 @@ class CombinationsArrayIterator implements Iterator
|
|||||||
$this->rewind();
|
$this->rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function rewind(): void
|
||||||
public function rewind()
|
|
||||||
{
|
{
|
||||||
if (!$this->numArrays) {
|
if (!$this->numArrays) {
|
||||||
$this->isValid = false;
|
$this->isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$this->isValid = true;
|
$this->isValid = true;
|
||||||
$this->k = 0;
|
$this->k = 0;
|
||||||
|
|
||||||
for ($i = 0; $i < $this->numArrays; $i++) {
|
for ($i = 0; $i < $this->numArrays; $i++) {
|
||||||
reset($this->arrays[$i]);
|
reset($this->arrays[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function valid(): bool
|
||||||
public function valid()
|
|
||||||
{
|
{
|
||||||
return $this->isValid;
|
return $this->isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function next(): void
|
||||||
public function next()
|
|
||||||
{
|
{
|
||||||
$this->k++;
|
$this->k++;
|
||||||
|
|
||||||
@ -71,8 +68,7 @@ class CombinationsArrayIterator implements Iterator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function current(): mixed
|
||||||
public function current()
|
|
||||||
{
|
{
|
||||||
$res = array();
|
$res = array();
|
||||||
for ($i = 0; $i < $this->numArrays; $i++) {
|
for ($i = 0; $i < $this->numArrays; $i++) {
|
||||||
@ -81,8 +77,7 @@ class CombinationsArrayIterator implements Iterator
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function key(): mixed
|
||||||
public function key()
|
|
||||||
{
|
{
|
||||||
return $this->k;
|
return $this->k;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,7 @@ class MultipleArrayIterator implements Iterator
|
|||||||
$this->rewind();
|
$this->rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function rewind(): void
|
||||||
public function rewind()
|
|
||||||
{
|
{
|
||||||
$this->active = $this->arrays;
|
$this->active = $this->arrays;
|
||||||
if ($this->active) {
|
if ($this->active) {
|
||||||
@ -31,20 +30,17 @@ class MultipleArrayIterator implements Iterator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function current(): mixed
|
||||||
public function current()
|
|
||||||
{
|
{
|
||||||
return $this->active ? current($this->active[0]) : false;
|
return $this->active ? current($this->active[0]) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function key(): mixed
|
||||||
public function key()
|
|
||||||
{
|
{
|
||||||
return $this->active ? key($this->active[0]) : false;
|
return $this->active ? key($this->active[0]) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function next(): void
|
||||||
public function next()
|
|
||||||
{
|
{
|
||||||
if (!$this->active) {
|
if (!$this->active) {
|
||||||
return;
|
return;
|
||||||
@ -58,8 +54,7 @@ class MultipleArrayIterator implements Iterator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function valid(): bool
|
||||||
public function valid()
|
|
||||||
{
|
{
|
||||||
return $this->active && (current($this->active[0] ?? []) !== false);
|
return $this->active && (current($this->active[0] ?? []) !== false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user