mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Inverted @param and @return hierarchy;
More fixes to tests and code coverage increase.
This commit is contained in:
@@ -19,7 +19,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
class MethodTag extends ParamTag
|
||||
class MethodTag extends ReturnTag
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
* Reflection class for a @param tag in a Docblock.
|
||||
*
|
||||
@@ -21,11 +19,8 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
class ParamTag extends Tag
|
||||
class ParamTag extends ReturnTag
|
||||
{
|
||||
/** @var string */
|
||||
protected $type = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -62,32 +57,6 @@ class ParamTag extends Tag
|
||||
$this->description = implode(' ', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique types of the variable.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypes()
|
||||
{
|
||||
$types = new \phpDocumentor\Reflection\DocBlock\Type\Collection(
|
||||
array($this->type),
|
||||
$this->docblock ? $this->docblock->getNamespace() : null,
|
||||
$this->docblock ? $this->docblock->getNamespaceAliases() : array()
|
||||
);
|
||||
|
||||
return $types->getArrayCopy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type section of the variable.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return implode('|', $this->getTypes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the variable's name.
|
||||
*
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
* Reflection class for a @return tag in a Docblock.
|
||||
*
|
||||
@@ -19,10 +21,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
class ReturnTag extends ParamTag
|
||||
class ReturnTag extends Tag
|
||||
{
|
||||
/** @var string */
|
||||
protected $type = null;
|
||||
protected $type = '';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
@@ -42,4 +44,30 @@ class ReturnTag extends ParamTag
|
||||
|
||||
$this->description = implode(' ', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique types of the variable.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypes()
|
||||
{
|
||||
$types = new \phpDocumentor\Reflection\DocBlock\Type\Collection(
|
||||
array($this->type),
|
||||
$this->docblock ? $this->docblock->getNamespace() : null,
|
||||
$this->docblock ? $this->docblock->getNamespaceAliases() : array()
|
||||
);
|
||||
|
||||
return $types->getArrayCopy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type section of the variable.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return implode('|', $this->getTypes());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user