Skip to content

Commit f3fa3fe

Browse files
committed
Remove unecessery types changes
1 parent 97a7e87 commit f3fa3fe

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/Collection/Iterator.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,20 @@ public function current()
110110
return $this->current->head();
111111
}
112112

113-
public function key(): mixed
113+
/**
114+
* @return int
115+
*/
116+
public function key()
114117
{
115118
return $this->index;
116119
}
117120

118-
public function valid(): bool
121+
public function valid()
119122
{
120123
return $this->hasNext();
121124
}
122125

123-
public function rewind(): void
126+
public function rewind()
124127
{
125128
$this->current = $this->traversable;
126129
}

src/Collection/Iterator/CompositeIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function next()
7272
return $this->current->next();
7373
}
7474

75-
public function rewind(): void
75+
public function rewind()
7676
{
7777
$this->iterators->rewind();
7878
$this->current = $this->iterators->current();

src/Collection/Iterator/EmptyIterator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public function hasNext(): bool
2323
return false;
2424
}
2525

26-
public function next(): void
26+
/**
27+
* @return void
28+
*/
29+
public function next()
2730
{
2831
throw new NoSuchElementException();
2932
}

src/Collection/Iterator/MapIterator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(array $map)
2424
/**
2525
* @return int|string|null
2626
*/
27-
public function key(): mixed
27+
public function key()
2828
{
2929
return key($this->map);
3030
}
@@ -34,7 +34,7 @@ public function current()
3434
return current($this->map);
3535
}
3636

37-
public function rewind(): void
37+
public function rewind()
3838
{
3939
reset($this->map);
4040
}
@@ -53,7 +53,7 @@ public function next()
5353
return $next;
5454
}
5555

56-
public function valid(): bool
56+
public function valid()
5757
{
5858
return key($this->map) !== null;
5959
}

src/Collection/Traversable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public function count(callable $predicate): int
295295
/**
296296
* @return Iterator<T>
297297
*/
298-
public function getIterator(): Iterator
298+
public function getIterator()
299299
{
300300
return $this->iterator();
301301
}

0 commit comments

Comments
 (0)