class RewindableGenerator
@internal
Hierarchy
- class \Symfony\Component\DependencyInjection\Argument\RewindableGenerator implements \Symfony\Component\DependencyInjection\Argument\IteratorAggregate, \Symfony\Component\DependencyInjection\Argument\Countable
Expanded class hierarchy of RewindableGenerator
5 files declare their use of RewindableGenerator
- CheckTypeDeclarationsPass.php in vendor/
symfony/ dependency-injection/ Compiler/ CheckTypeDeclarationsPass.php - Container.php in vendor/
symfony/ dependency-injection/ Container.php - Container.php in core/
lib/ Drupal/ Component/ DependencyInjection/ Container.php - ContainerBuilder.php in vendor/
symfony/ dependency-injection/ ContainerBuilder.php - PhpArrayContainer.php in core/
lib/ Drupal/ Component/ DependencyInjection/ PhpArrayContainer.php
File
-
vendor/
symfony/ dependency-injection/ Argument/ RewindableGenerator.php, line 17
Namespace
Symfony\Component\DependencyInjection\ArgumentView source
class RewindableGenerator implements \IteratorAggregate, \Countable {
private \Closure $generator;
private \Closure|int $count;
public function __construct(callable $generator, int|callable $count) {
$this->generator = $generator(...);
$this->count = \is_int($count) ? $count : $count(...);
}
public function getIterator() : \Traversable {
$g = $this->generator;
return $g();
}
public function count() : int {
if (!\is_int($count = $this->count)) {
$this->count = $count();
}
return $this->count;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
RewindableGenerator::$count | private | property | |
RewindableGenerator::$generator | private | property | |
RewindableGenerator::count | public | function | |
RewindableGenerator::getIterator | public | function | |
RewindableGenerator::__construct | public | function |