Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

service_collection_iterator.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 1.02 KiB


01  <?php
02  /**
03  *
04  * This file is part of the phpBB Forum Software package.
05  *
06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
07  * @license GNU General Public License, version 2 (GPL-2.0)
08  *
09  * For full copyright and license information, please see
10  * the docs/CREDITS.txt file.
11  *
12  */
13   
14  namespace phpbb\di;
15   
16  /**
17  * Iterator which loads the services when they are requested
18  */
19  class service_collection_iterator extends \ArrayIterator
20  {
21      /**
22      * @var \phpbb\di\service_collection
23      */
24      protected $collection;
25   
26      /**
27      * Construct an ArrayIterator for service_collection
28      *
29      * @param \phpbb\di\service_collection $collection The collection to iterate over
30      * @param int $flags Flags to control the behaviour of the ArrayObject object.
31      * @see ArrayObject::setFlags()
32      */
33      public function __construct(service_collection $collection, $flags = 0)
34      {
35          parent::__construct($collection->getArrayCopy(), $flags);
36          $this->collection = $collection;
37      }
38   
39      /**
40      * {@inheritdoc}
41      */
42      public function current()
43      {
44          return $this->collection->offsetGet($this->key());
45      }
46  }
47