✏️ 正在编辑: RewindableGenerator.php
路径:
/opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/illuminate/container/RewindableGenerator.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php namespace RectorPrefix202411\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; } }
💾 保存文件
← 返回文件管理器