DigiComp.FluidRenderFunctions/Classes/Utils/GeneratorClosureIterator.php
Ferdinand Kuhl 0de901d45c
Some checks failed
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline failed
ci/woodpecker/push/functional-tests/2 Pipeline failed
ci/woodpecker/push/functional-tests/3 Pipeline failed
ci/woodpecker/push/functional-tests/4 Pipeline failed
First working version
2024-06-01 23:15:35 +02:00

21 lines
392 B
PHP

<?php
namespace DigiComp\FluidRenderFunctions\Utils;
class GeneratorClosureIterator implements \IteratorAggregate
{
private \Closure $closure;
/**
* @param \Closure $closure
*/
public function __construct(\Closure $closure)
{
$this->closure = $closure;
}
public function getIterator(): \Generator
{
return ($this->closure)();
}
}