![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/rector/rector/vendor/illuminate/container/ |
<?php namespace RectorPrefix202308\Illuminate\Container; use Countable; use IteratorAggregate; use Traversable; class RewindableGenerator implements Countable, IteratorAggregate { /** * The generator callback. * * @var callable */ protected $generator; /** * The number of tagged services. * * @var callable|int */ protected $count; /** * Create a new generator instance. * * @param callable $generator * @param callable|int $count * @return void */ public function __construct(callable $generator, $count) { $this->count = $count; $this->generator = $generator; } /** * Get an iterator from the generator. * * @return \Traversable */ public function getIterator() : Traversable { return ($this->generator)(); } /** * Get the total number of tagged services. * * @return int */ public function count() : int { if (\is_callable($count = $this->count)) { $this->count = $count(); } return $this->count; } }