Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RewindableGenerator.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\DependencyInjection\Argument;
13
14 /**
15 * @internal
16 */
17 class RewindableGenerator implements \IteratorAggregate, \Countable
18 {
19 private $generator;
20 private $count;
21
22 /**
23 * @param int|callable $count
24 */
25 public function __construct(callable $generator, $count)
26 {
27 $this->generator = $generator;
28 $this->count = $count;
29 }
30
31 public function getIterator()
32 {
33 $g = $this->generator;
34
35 return $g();
36 }
37
38 public function count()
39 {
40 if (\is_callable($count = $this->count)) {
41 $this->count = $count();
42 }
43
44 return $this->count;
45 }
46 }
47