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

MethodTag.php

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