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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ParamTag.php
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\Generator\DocBlock\Tag;
011
012 use Zend\Code\Generator\DocBlock\TagManager;
013 use Zend\Code\Reflection\DocBlock\Tag\TagInterface as ReflectionTagInterface;
014
015 class ParamTag extends AbstractTypeableTag implements TagInterface
016 {
017 /**
018 * @var string
019 */
020 protected $variableName = null;
021
022 /**
023 * @param string $variableName
024 * @param array $types
025 * @param string $description
026 */
027 public function __construct($variableName = null, $types = array(), $description = null)
028 {
029 if (!empty($variableName)) {
030 $this->setVariableName($variableName);
031 }
032
033 parent::__construct($types, $description);
034 }
035
036 /**
037 * @param ReflectionTagInterface $reflectionTag
038 * @return ReturnTag
039 * @deprecated Deprecated in 2.3. Use TagManager::createTagFromReflection() instead
040 */
041 public static function fromReflection(ReflectionTagInterface $reflectionTag)
042 {
043 $tagManager = new TagManager();
044 $tagManager->initializeDefaultTags();
045 return $tagManager->createTagFromReflection($reflectionTag);
046 }
047
048 /**
049 * @return string
050 */
051 public function getName()
052 {
053 return 'param';
054 }
055
056 /**
057 * @param string $variableName
058 * @return ParamTag
059 */
060 public function setVariableName($variableName)
061 {
062 $this->variableName = ltrim($variableName, '$');
063 return $this;
064 }
065
066 /**
067 * @return string
068 */
069 public function getVariableName()
070 {
071 return $this->variableName;
072 }
073
074 /**
075 * @param string $datatype
076 * @return ReturnTag
077 * @deprecated Deprecated in 2.3. Use setTypes() instead
078 */
079 public function setDatatype($datatype)
080 {
081 return $this->setTypes($datatype);
082 }
083
084 /**
085 * @return string
086 * @deprecated Deprecated in 2.3. Use getTypes() or getTypesAsString() instead
087 */
088 public function getDatatype()
089 {
090 return $this->getTypesAsString();
091 }
092
093 /**
094 * @param string $paramName
095 * @return ParamTag
096 * @deprecated Deprecated in 2.3. Use setVariableName() instead
097 */
098 public function setParamName($paramName)
099 {
100 return $this->setVariableName($paramName);
101 }
102
103 /**
104 * @return string
105 * @deprecated Deprecated in 2.3. Use getVariableName() instead
106 */
107 public function getParamName()
108 {
109 return $this->getVariableName();
110 }
111
112 /**
113 * @return string
114 */
115 public function generate()
116 {
117 $output = '@param'
118 . ((!empty($this->types)) ? ' ' . $this->getTypesAsString() : '')
119 . ((!empty($this->variableName)) ? ' $' . $this->variableName : '')
120 . ((!empty($this->description)) ? ' ' . $this->description : '');
121
122 return $output;
123 }
124 }
125