Skip to content

Commit

Permalink
Remove unecessery types changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtk3d committed Feb 22, 2023
1 parent 97a7e87 commit f3fa3fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/Collection/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,20 @@ public function current()
return $this->current->head();
}

public function key(): mixed
/**
* @return int
*/
public function key()
{
return $this->index;
}

public function valid(): bool
public function valid()
{
return $this->hasNext();
}

public function rewind(): void
public function rewind()
{
$this->current = $this->traversable;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/CompositeIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function next()
return $this->current->next();
}

public function rewind(): void
public function rewind()
{
$this->iterators->rewind();
$this->current = $this->iterators->current();
Expand Down
5 changes: 4 additions & 1 deletion src/Collection/Iterator/EmptyIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public function hasNext(): bool
return false;
}

public function next(): void
/**
* @return void
*/
public function next()
{
throw new NoSuchElementException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Collection/Iterator/MapIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(array $map)
/**
* @return int|string|null
*/
public function key(): mixed
public function key()
{
return key($this->map);
}
Expand All @@ -34,7 +34,7 @@ public function current()
return current($this->map);
}

public function rewind(): void
public function rewind()
{
reset($this->map);
}
Expand All @@ -53,7 +53,7 @@ public function next()
return $next;
}

public function valid(): bool
public function valid()
{
return key($this->map) !== null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Traversable.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function count(callable $predicate): int
/**
* @return Iterator<T>
*/
public function getIterator(): Iterator
public function getIterator()
{
return $this->iterator();
}
Expand Down

0 comments on commit f3fa3fe

Please sign in to comment.