2021-08-27 06:46:27 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Symfony\Component\Console\Helper;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
class TableRows implements \IteratorAggregate
|
|
|
|
{
|
2022-03-14 16:22:30 -04:00
|
|
|
private \Closure $generator;
|
2021-08-27 06:46:27 -04:00
|
|
|
|
2022-03-14 16:22:30 -04:00
|
|
|
public function __construct(\Closure $generator)
|
2021-08-27 06:46:27 -04:00
|
|
|
{
|
|
|
|
$this->generator = $generator;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIterator(): \Traversable
|
|
|
|
{
|
2022-03-14 16:22:30 -04:00
|
|
|
return ($this->generator)();
|
2021-08-27 06:46:27 -04:00
|
|
|
}
|
|
|
|
}
|