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

MethodTag.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 2.29 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-2016 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\DocBlock\Tag;
011   
012  use function explode;
013  use function preg_match;
014  use function rtrim;
015   
016  class MethodTag implements TagInterface, PhpDocTypedTagInterface
017  {
018      /**
019       * Return value type
020       *
021       * @var array
022       */
023      protected $types = [];
024   
025      /**
026       * @var string
027       */
028      protected $methodName;
029   
030      /**
031       * @var string
032       */
033      protected $description;
034   
035      /**
036       * Is static method
037       *
038       * @var bool
039       */
040      protected $isStatic = false;
041   
042      /**
043       * @return string
044       */
045      public function getName()
046      {
047          return 'method';
048      }
049   
050      /**
051       * Initializer
052       *
053       * @param  string $tagDocblockLine
054       */
055      public function initialize($tagDocblockLine)
056      {
057          $match = [];
058   
059          if (! preg_match('#^(static[\s]+)?(.+[\s]+)?(.+\(\))[\s]*(.*)$#m', $tagDocblockLine, $match)) {
060              return;
061          }
062   
063          if ($match[1] !== '') {
064              $this->isStatic = true;
065          }
066   
067          if ($match[2] !== '') {
068              $this->types = explode('|', rtrim($match[2]));
069          }
070   
071          $this->methodName = $match[3];
072   
073          if ($match[4] !== '') {
074              $this->description = $match[4];
075          }
076      }
077   
078      /**
079       * Get return value type
080       *
081       * @return null|string
082       * @deprecated 2.0.4 use getTypes instead
083       */
084      public function getReturnType()
085      {
086          if (empty($this->types)) {
087              return;
088          }
089   
090          return $this->types[0];
091      }
092   
093      public function getTypes()
094      {
095          return $this->types;
096      }
097   
098      /**
099       * @return string
100       */
101      public function getMethodName()
102      {
103          return $this->methodName;
104      }
105   
106      /**
107       * @return null|string
108       */
109      public function getDescription()
110      {
111          return $this->description;
112      }
113   
114      /**
115       * @return bool
116       */
117      public function isStatic()
118      {
119          return $this->isStatic;
120      }
121   
122      public function __toString()
123      {
124          return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
125      }
126  }
127