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

TypedReference.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 1.43 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;
13   
14  /**
15   * Represents a PHP type-hinted service reference.
16   *
17   * @author Nicolas Grekas <p@tchwork.com>
18   */
19  class TypedReference extends Reference
20  {
21      private $type;
22      private $requiringClass;
23   
24      /**
25       * @param string $id              The service identifier
26       * @param string $type            The PHP type of the identified service
27       * @param string $requiringClass  The class of the service that requires the referenced type
28       * @param int    $invalidBehavior The behavior when the service does not exist
29       */
30      public function __construct($id, $type, $requiringClass = '', $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
31      {
32          parent::__construct($id, $invalidBehavior);
33          $this->type = $type;
34          $this->requiringClass = $requiringClass;
35      }
36   
37      public function getType()
38      {
39          return $this->type;
40      }
41   
42      public function getRequiringClass()
43      {
44          return $this->requiringClass;
45      }
46   
47      public function canBeAutoregistered()
48      {
49          return $this->requiringClass && (false !== $i = strpos($this->type, '\\')) && 0 === strncasecmp($this->type, $this->requiringClass, 1 + $i);
50      }
51  }
52