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

ClassNameInflector.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.88 KiB


01  <?php
02   
03  declare(strict_types=1);
04   
05  namespace ProxyManager\Inflector;
06   
07  use ProxyManager\Inflector\Util\ParameterHasher;
08   
09  /**
10   * {@inheritDoc}
11   *
12   * @author Marco Pivetta <ocramius@gmail.com>
13   * @license MIT
14   */
15  final class ClassNameInflector implements ClassNameInflectorInterface
16  {
17      /**
18       * @var string
19       */
20      protected $proxyNamespace;
21   
22      /**
23       * @var int
24       */
25      private $proxyMarkerLength;
26   
27      /**
28       * @var string
29       */
30      private $proxyMarker;
31   
32      /**
33       * @var \ProxyManager\Inflector\Util\ParameterHasher
34       */
35      private $parameterHasher;
36   
37      /**
38       * @param string $proxyNamespace
39       */
40      public function __construct(string $proxyNamespace)
41      {
42          $this->proxyNamespace    = $proxyNamespace;
43          $this->proxyMarker       = '\\' . static::PROXY_MARKER . '\\';
44          $this->proxyMarkerLength = strlen($this->proxyMarker);
45          $this->parameterHasher   = new ParameterHasher();
46      }
47   
48      /**
49       * {@inheritDoc}
50       */
51      public function getUserClassName(string $className) : string
52      {
53          $className = ltrim($className, '\\');
54   
55          if (false === $position = strrpos($className, $this->proxyMarker)) {
56              return $className;
57          }
58   
59          return substr(
60              $className,
61              $this->proxyMarkerLength + $position,
62              strrpos($className, '\\') - ($position + $this->proxyMarkerLength)
63          );
64      }
65   
66      /**
67       * {@inheritDoc}
68       */
69      public function getProxyClassName(string $className, array $options = []) : string
70      {
71          return $this->proxyNamespace
72              . $this->proxyMarker
73              . $this->getUserClassName($className)
74              . '\\Generated' . $this->parameterHasher->hashParameters($options);
75      }
76   
77      /**
78       * {@inheritDoc}
79       */
80      public function isProxyClassName(string $className) : bool
81      {
82          return false !== strrpos($className, $this->proxyMarker);
83      }
84  }
85