IteratorAggregateFixture.php 396 B

12345678910111213141516171819202122
  1. <?php
  2. namespace MathPHP\Tests\Util;
  3. class IteratorAggregateFixture implements \IteratorAggregate
  4. {
  5. /** @var array */
  6. private $values;
  7. /**
  8. * @param array $values
  9. */
  10. public function __construct(array $values)
  11. {
  12. $this->values = $values;
  13. }
  14. public function getIterator(): \ArrayIterator
  15. {
  16. return new \ArrayIterator($this->values);
  17. }
  18. }