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

DefaultsConfigurator.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.87 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\Loader\Configurator;
13   
14  use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
15   
16  /**
17   * @author Nicolas Grekas <p@tchwork.com>
18   *
19   * @method InstanceofConfigurator instanceof(string $fqcn)
20   */
21  class DefaultsConfigurator extends AbstractServiceConfigurator
22  {
23      const FACTORY = 'defaults';
24   
25      use Traits\AutoconfigureTrait;
26      use Traits\AutowireTrait;
27      use Traits\BindTrait;
28      use Traits\PublicTrait;
29   
30      /**
31       * Adds a tag for this definition.
32       *
33       * @param string $name       The tag name
34       * @param array  $attributes An array of attributes
35       *
36       * @return $this
37       *
38       * @throws InvalidArgumentException when an invalid tag name or attribute is provided
39       */
40      final public function tag($name, array $attributes = [])
41      {
42          if (!\is_string($name) || '' === $name) {
43              throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
44          }
45   
46          foreach ($attributes as $attribute => $value) {
47              if (!is_scalar($value) && null !== $value) {
48                  throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
49              }
50          }
51   
52          $this->definition->addTag($name, $attributes);
53   
54          return $this;
55      }
56   
57      /**
58       * Defines an instanceof-conditional to be applied to following service definitions.
59       *
60       * @param string $fqcn
61       *
62       * @return InstanceofConfigurator
63       */
64      final protected function setInstanceof($fqcn)
65      {
66          return $this->parent->instanceof($fqcn);
67      }
68  }
69