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

BindTrait.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.48 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  use Symfony\Component\DependencyInjection\Reference;
16   
17  trait BindTrait
18  {
19      /**
20       * Sets bindings.
21       *
22       * Bindings map $named or FQCN arguments to values that should be
23       * injected in the matching parameters (of the constructor, of methods
24       * called and of controller actions).
25       *
26       * @param string $nameOrFqcn A parameter name with its "$" prefix, or a FQCN
27       * @param mixed  $valueOrRef The value or reference to bind
28       *
29       * @return $this
30       */
31      final public function bind($nameOrFqcn, $valueOrRef)
32      {
33          $valueOrRef = static::processValue($valueOrRef, true);
34          if (isset($nameOrFqcn[0]) && '$' !== $nameOrFqcn[0] && !$valueOrRef instanceof Reference) {
35              throw new InvalidArgumentException(sprintf('Invalid binding for service "%s": named arguments must start with a "$", and FQCN must map to references. Neither applies to binding "%s".', $this->id, $nameOrFqcn));
36          }
37          $bindings = $this->definition->getBindings();
38          $bindings[$nameOrFqcn] = $valueOrRef;
39          $this->definition->setBindings($bindings);
40   
41          return $this;
42      }
43  }
44