[ Index ]

PHP Cross Reference of phpBB-3.3.2-deutsch

title

Body

[close]

/vendor/zendframework/zend-code/src/Reflection/DocBlock/Tag/ -> GenericTag.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-2016 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  use Zend\Code\Generic\Prototype\PrototypeGenericInterface;
  13  
  14  use function explode;
  15  use function trim;
  16  
  17  class GenericTag implements TagInterface, PrototypeGenericInterface
  18  {
  19      /**
  20       * @var string
  21       */
  22      protected $name;
  23  
  24      /**
  25       * @var string
  26       */
  27      protected $content;
  28  
  29      /**
  30       * @var null|string
  31       */
  32      protected $contentSplitCharacter;
  33  
  34      /**
  35       * @var array
  36       */
  37      protected $values = [];
  38  
  39      /**
  40       * @param  string $contentSplitCharacter
  41       */
  42      public function __construct($contentSplitCharacter = ' ')
  43      {
  44          $this->contentSplitCharacter = $contentSplitCharacter;
  45      }
  46  
  47      /**
  48       * @param  string $tagDocBlockLine
  49       * @return void
  50       */
  51      public function initialize($tagDocBlockLine)
  52      {
  53          $this->parse($tagDocBlockLine);
  54      }
  55  
  56      /**
  57       * Get annotation tag name
  58       *
  59       * @return string
  60       */
  61      public function getName()
  62      {
  63          return $this->name;
  64      }
  65  
  66      /**
  67       * @param  string $name
  68       */
  69      public function setName($name)
  70      {
  71          $this->name = $name;
  72      }
  73  
  74      /**
  75       * @return string
  76       */
  77      public function getContent()
  78      {
  79          return $this->content;
  80      }
  81  
  82      /**
  83       * @param  int $position
  84       * @return string
  85       */
  86      public function returnValue($position)
  87      {
  88          return $this->values[$position];
  89      }
  90  
  91      /**
  92       * Serialize to string
  93       *
  94       * Required by Reflector
  95       *
  96       * @todo   What should this do?
  97       * @return string
  98       */
  99      public function __toString()
 100      {
 101          return 'DocBlock Tag [ * @' . $this->name . ' ]' . "\n";
 102      }
 103  
 104      /**
 105       * @param  string $docBlockLine
 106       */
 107      protected function parse($docBlockLine)
 108      {
 109          $this->content = trim($docBlockLine);
 110          $this->values = explode($this->contentSplitCharacter, $docBlockLine);
 111      }
 112  }


Generated: Wed Nov 11 20:28:18 2020 Cross-referenced by PHPXref 0.7.1