for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
/*
* This file is part of the KleijnWeb\PhpApi\Descriptions package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KleijnWeb\PhpApi\Descriptions\Description\Respository;
use KleijnWeb\PhpApi\Descriptions\Description\Repository;
/**
* @author John Kleijn <[email protected]>
class RepositoryIterator implements \Iterator
{
* @var Repository
private $repository;
* @var int
private $position = 0;
* @param Repository $repository
public function __construct(Repository $repository)
$this->repository = $repository;
}
* {@inheritdoc}
public function rewind()
$this->position = 0;
public function current()
return $this->repository->get($this->key());
public function key()
return $this->repository->getUris()[$this->position];
public function next()
++$this->position;
public function valid(): bool
return isset($this->repository->getUris()[$this->position]);