PHP 8.2.31
Preview: RewindableGenerator.php Size: 1.12 KB
/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;
    }
}

Directory Contents

Dirs: 1 × Files: 9

Name Size Perms Modified Actions
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
7.31 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
938 B lrwxr-xr-x 2024-11-08 13:59:10
Edit Download
43.06 KB lrwxr-xr-x 2024-11-08 13:59:10
Edit Download
2.39 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
235 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.05 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
266 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.12 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
2.17 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).