opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
vendor
/
illuminate
/
container
➕ New
📤 Upload
✎ Editing:
RewindableGenerator.php
← Back
<?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; } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel