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

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

IteratorArgument.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.38 KiB


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  use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
15  use Symfony\Component\DependencyInjection\Reference;
16   
17  /**
18   * Represents a collection of values to lazily iterate over.
19   *
20   * @author Titouan Galopin <galopintitouan@gmail.com>
21   */
22  class IteratorArgument implements ArgumentInterface
23  {
24      private $values;
25   
26      /**
27       * @param Reference[] $values
28       */
29      public function __construct(array $values)
30      {
31          $this->setValues($values);
32      }
33   
34      /**
35       * @return array The values to lazily iterate over
36       */
37      public function getValues()
38      {
39          return $this->values;
40      }
41   
42      /**
43       * @param Reference[] $values The service references to lazily iterate over
44       */
45      public function setValues(array $values)
46      {
47          foreach ($values as $k => $v) {
48              if (null !== $v && !$v instanceof Reference) {
49                  throw new InvalidArgumentException(sprintf('An IteratorArgument must hold only Reference instances, "%s" given.', \is_object($v) ? \get_class($v) : \gettype($v)));
50              }
51          }
52   
53          $this->values = $values;
54      }
55  }
56