WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

YoastSEO_Vendor\Symfony\Component\DependencyInjection\Argument

RewindableGenerator{} Yoast 1.0

Хуков нет.

Возвращает

null. Ничего.

Использование

$RewindableGenerator = new RewindableGenerator();
// use class methods

Методы

  1. __construct(callable $generator, $count)
  2. count()
  3. getIterator()

Код RewindableGenerator{} Yoast 17.1

class RewindableGenerator implements \IteratorAggregate, \Countable
{
    private $generator;
    private $count;
    /**
     * @param int|callable $count
     */
    public function __construct(callable $generator, $count)
    {
        $this->generator = $generator;
        $this->count = $count;
    }
    public function getIterator()
    {
        $g = $this->generator;
        return $g();
    }
    public function count()
    {
        if (\is_callable($count = $this->count)) {
            $this->count = $count();
        }
        return $this->count;
    }
}