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

TagTrait.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.23 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\Traits;
13   
14  use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
15   
16  trait TagTrait
17  {
18      /**
19       * Adds a tag for this definition.
20       *
21       * @param string $name       The tag name
22       * @param array  $attributes An array of attributes
23       *
24       * @return $this
25       */
26      final public function tag($name, array $attributes = [])
27      {
28          if (!\is_string($name) || '' === $name) {
29              throw new InvalidArgumentException(sprintf('The tag name for service "%s" must be a non-empty string.', $this->id));
30          }
31   
32          foreach ($attributes as $attribute => $value) {
33              if (!is_scalar($value) && null !== $value) {
34                  throw new InvalidArgumentException(sprintf('A tag attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $this->id, $name, $attribute));
35              }
36          }
37   
38          $this->definition->addTag($name, $attributes);
39   
40          return $this;
41      }
42  }
43