Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

ParameterReflection.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 2.77 KiB


001  <?php
002  /**
003   * Zend Framework (http://framework.zend.com/)
004   *
005   * @link      http://github.com/zendframework/zf2 for the canonical source repository
006   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
007   * @license   http://framework.zend.com/license/new-bsd New BSD License
008   */
009   
010  namespace Zend\Code\Reflection;
011   
012  use ReflectionParameter;
013   
014  class ParameterReflection extends ReflectionParameter implements ReflectionInterface
015  {
016      /**
017       * @var bool
018       */
019      protected $isFromMethod = false;
020   
021      /**
022       * Get declaring class reflection object
023       *
024       * @return ClassReflection
025       */
026      public function getDeclaringClass()
027      {
028          $phpReflection  = parent::getDeclaringClass();
029          $zendReflection = new ClassReflection($phpReflection->getName());
030          unset($phpReflection);
031   
032          return $zendReflection;
033      }
034   
035      /**
036       * Get class reflection object
037       *
038       * @return ClassReflection
039       */
040      public function getClass()
041      {
042          $phpReflection = parent::getClass();
043          if ($phpReflection === null) {
044              return;
045          }
046   
047          $zendReflection = new ClassReflection($phpReflection->getName());
048          unset($phpReflection);
049   
050          return $zendReflection;
051      }
052   
053      /**
054       * Get declaring function reflection object
055       *
056       * @return FunctionReflection|MethodReflection
057       */
058      public function getDeclaringFunction()
059      {
060          $phpReflection = parent::getDeclaringFunction();
061          if ($phpReflection instanceof \ReflectionMethod) {
062              $zendReflection = new MethodReflection($this->getDeclaringClass()->getName(), $phpReflection->getName());
063          } else {
064              $zendReflection = new FunctionReflection($phpReflection->getName());
065          }
066          unset($phpReflection);
067   
068          return $zendReflection;
069      }
070   
071      /**
072       * Get parameter type
073       *
074       * @return string
075       */
076      public function getType()
077      {
078          if ($this->isArray()) {
079              return 'array';
080          } elseif (method_exists($this, 'isCallable') && $this->isCallable()) {
081              return 'callable';
082          }
083   
084          if (($class = $this->getClass()) instanceof \ReflectionClass) {
085              return $class->getName();
086          }
087   
088          $docBlock = $this->getDeclaringFunction()->getDocBlock();
089          if (!$docBlock instanceof DocBlockReflection) {
090              return;
091          }
092   
093          $params = $docBlock->getTags('param');
094          if (isset($params[$this->getPosition()])) {
095              return $params[$this->getPosition()]->getType();
096          }
097   
098          return;
099      }
100   
101      /**
102       * @return string
103       */
104      public function toString()
105      {
106          return parent::__toString();
107      }
108   
109      /**
110       * @return string
111       */
112      public function __toString()
113      {
114          return parent::__toString();
115      }
116  }
117