for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Seboettg\Collection\NativePhp;
trait IteratorTrait
{
private int $offset = 0;
/**
* {@inheritdoc}
*/
public function current()
return $this->valid() ? $this->array[$this->offset] : false;
}
public function key(): int
return $this->offset;
public function next(): void
++$this->offset;
public function valid(): bool
return isset($this->array[$this->offset]);
public function rewind(): void
$this->offset = 0;