<?php

 
 
 
 
 
 






namespace Google\Protobuf\Internal;





class RepeatedFieldIter implements \Iterator
{

    


    private $position;
    


    private $container;

    





    public function __construct($container)
    {
        $this->position = 0;
        $this->container = $container;
    }

    





    #[\ReturnTypeWillChange]
    public function rewind()
    {
        $this->position = 0;
    }

    





    #[\ReturnTypeWillChange]
    public function current()
    {
        return $this->container[$this->position];
    }

    





    #[\ReturnTypeWillChange]
    public function key()
    {
        return $this->position;
    }

    





    #[\ReturnTypeWillChange]
    public function next()
    {
        ++$this->position;
    }

    




    public function valid(): bool
    {
        return isset($this->container[$this->position]);
    }
}
