[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/zendframework/zend-code/src/Reflection/DocBlock/Tag/ -> MethodTag.php (source)

   1  <?php
   2  /**
   3   * Zend Framework (http://framework.zend.com/)
   4   *
   5   * @link      http://github.com/zendframework/zf2 for the canonical source repository
   6   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
   7   * @license   http://framework.zend.com/license/new-bsd New BSD License
   8   */
   9  
  10  namespace Zend\Code\Reflection\DocBlock\Tag;
  11  
  12  class MethodTag implements TagInterface, PhpDocTypedTagInterface
  13  {
  14      /**
  15       * Return value type
  16       *
  17       * @var array
  18       */
  19      protected $types = array();
  20  
  21      /**
  22       * @var string
  23       */
  24      protected $methodName = null;
  25  
  26      /**
  27       * @var string
  28       */
  29      protected $description = null;
  30  
  31      /**
  32       * Is static method
  33       *
  34       * @var bool
  35       */
  36      protected $isStatic = false;
  37  
  38      /**
  39       * @return string
  40       */
  41      public function getName()
  42      {
  43          return 'method';
  44      }
  45  
  46      /**
  47       * Initializer
  48       *
  49       * @param  string $tagDocblockLine
  50       */
  51      public function initialize($tagDocblockLine)
  52      {
  53          $match = array();
  54  
  55          if (!preg_match('#^(static[\s]+)?(.+[\s]+)?(.+\(\))[\s]*(.*)$#m', $tagDocblockLine, $match)) {
  56              return;
  57          }
  58  
  59          if ($match[1] !== '') {
  60              $this->isStatic = true;
  61          }
  62  
  63          if ($match[2] !== '') {
  64              $this->types = explode('|', rtrim($match[2]));
  65          }
  66  
  67          $this->methodName = $match[3];
  68  
  69          if ($match[4] !== '') {
  70              $this->description = $match[4];
  71          }
  72      }
  73  
  74      /**
  75       * Get return value type
  76       *
  77       * @return null|string
  78       * @deprecated 2.0.4 use getTypes instead
  79       */
  80      public function getReturnType()
  81      {
  82          if (empty($this->types)) {
  83              return;
  84          }
  85  
  86          return $this->types[0];
  87      }
  88  
  89      public function getTypes()
  90      {
  91          return $this->types;
  92      }
  93  
  94      /**
  95       * @return string
  96       */
  97      public function getMethodName()
  98      {
  99          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  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1