4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Finder\Tests\Iterator;
14 class Iterator implements \Iterator
16 protected $values = array();
18 public function __construct(array $values = array())
20 foreach ($values as $value) {
21 $this->attach(new \SplFileInfo($value));
26 public function attach(\SplFileInfo $fileinfo)
28 $this->values[] = $fileinfo;
31 public function rewind()
36 public function valid()
38 return false !== $this->current();
41 public function next()
46 public function current()
48 return current($this->values);
53 return key($this->values);