mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Moved the type separation into ReturnTag, for consistency with the type merging that is currently there.
This commit is contained in:
@@ -53,7 +53,7 @@ class ReturnTag extends Tag
|
||||
public function getTypes()
|
||||
{
|
||||
$types = new \phpDocumentor\Reflection\DocBlock\Type\Collection(
|
||||
array($this->type),
|
||||
explode('|', $this->type),
|
||||
$this->docblock ? $this->docblock->getNamespace() : null,
|
||||
$this->docblock ? $this->docblock->getNamespaceAliases() : array()
|
||||
);
|
||||
|
||||
@@ -22,9 +22,6 @@ namespace phpDocumentor\Reflection\DocBlock\Type;
|
||||
*/
|
||||
class Collection extends \ArrayObject
|
||||
{
|
||||
/** @var string Definition of the OR operator for types */
|
||||
const OPERATOR_OR = '|';
|
||||
|
||||
/** @var string Definition of the ARRAY operator for types */
|
||||
const OPERATOR_ARRAY = '[]';
|
||||
|
||||
@@ -167,14 +164,9 @@ class Collection extends \ArrayObject
|
||||
.var_export($type, true)
|
||||
);
|
||||
}
|
||||
|
||||
// separate the type by the OR operator
|
||||
$type_parts = explode(self::OPERATOR_OR, $type);
|
||||
foreach ($type_parts as $part) {
|
||||
$expanded_type = $this->expand($part);
|
||||
if ($expanded_type) {
|
||||
$this[] = $expanded_type;
|
||||
}
|
||||
$expanded_type = $this->expand($type);
|
||||
if ($expanded_type) {
|
||||
$this[] = $expanded_type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user