mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
9
Commits
context-fix
...
2.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd9e6bd26d | ||
|
|
d5e4b2ec73 | ||
|
|
bae8be0dcd | ||
|
|
3a5d30e027 | ||
|
|
d2414cd3dc | ||
|
|
070b13745a | ||
|
|
df7807cd73 | ||
|
|
b07e3c36b7 | ||
|
|
163dd7877e |
+5
-3
@@ -1,16 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-docblock",
|
"name": "barryvdh/reflection-docblock",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{"name": "Mike van Riel", "email": "[email protected]"}
|
{"name": "Mike van Riel", "email": "[email protected]"}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.3",
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
"dflydev/markdown": "1.0.*"
|
"dflydev/markdown": "1.0.*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": {"phpDocumentor": ["src/"]}
|
"psr-0": {"Barryvdh": ["src/"]}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "3.7.*@stable"
|
"phpunit/phpunit": "3.7.*@stable"
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection;
|
namespace Barryvdh\Reflection;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
use phpDocumentor\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
use phpDocumentor\Reflection\DocBlock\Location;
|
use Barryvdh\Reflection\DocBlock\Location;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the DocBlock for any structure.
|
* Parses the DocBlock for any structure.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The context in which a DocBlock occurs.
|
* The context in which a DocBlock occurs.
|
||||||
+4
-6
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock;
|
use Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a Description of a DocBlock or tag.
|
* Parses a Description of a DocBlock or tag.
|
||||||
@@ -209,14 +209,12 @@ class Description implements \Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the exported information (we should use the export static method
|
* Returns the long description as a string.
|
||||||
* BUT this throws an exception at this point).
|
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @codeCoverageIgnore Not yet implemented
|
|
||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return 'Not yet implemented';
|
return $this->getContents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The location a DocBlock occurs within a file.
|
* The location a DocBlock occurs within a file.
|
||||||
+3
-3
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock;
|
use Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes a DocBlock instance.
|
* Serializes a DocBlock instance.
|
||||||
@@ -182,7 +182,7 @@ class Serializer
|
|||||||
|
|
||||||
/** @var Tag $tag */
|
/** @var Tag $tag */
|
||||||
foreach ($docblock->getTags() as $tag) {
|
foreach ($docblock->getTags() as $tag) {
|
||||||
$tagText = "@{$tag->getName()} {$tag->getContent()}";
|
$tagText = (string) $tag;
|
||||||
if ($this->lineLength) {
|
if ($this->lineLength) {
|
||||||
$tagText = wordwrap($tagText, $wrapLength);
|
$tagText = wordwrap($tagText, $wrapLength);
|
||||||
}
|
}
|
||||||
+23
-25
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock;
|
namespace Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock;
|
use Barryvdh\Reflection\DocBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a tag definition for a DocBlock.
|
* Parses a tag definition for a DocBlock.
|
||||||
@@ -59,43 +59,43 @@ class Tag implements \Reflector
|
|||||||
*/
|
*/
|
||||||
private static $tagHandlerMappings = array(
|
private static $tagHandlerMappings = array(
|
||||||
'author'
|
'author'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\AuthorTag',
|
||||||
'covers'
|
'covers'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\CoversTag',
|
||||||
'deprecated'
|
'deprecated'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag',
|
||||||
'example'
|
'example'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\ExampleTag',
|
||||||
'link'
|
'link'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\LinkTag',
|
||||||
'method'
|
'method'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\MethodTag',
|
||||||
'param'
|
'param'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\ParamTag',
|
||||||
'property-read'
|
'property-read'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyReadTag',
|
||||||
'property'
|
'property'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyTag',
|
||||||
'property-write'
|
'property-write'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyWriteTag',
|
||||||
'return'
|
'return'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\ReturnTag',
|
||||||
'see'
|
'see'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\SeeTag',
|
||||||
'since'
|
'since'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\SinceTag',
|
||||||
'source'
|
'source'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\SourceTag',
|
||||||
'throw'
|
'throw'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag',
|
||||||
'throws'
|
'throws'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag',
|
||||||
'uses'
|
'uses'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\UsesTag',
|
||||||
'var'
|
'var'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\VarTag',
|
=> '\Barryvdh\Reflection\DocBlock\Tag\VarTag',
|
||||||
'version'
|
'version'
|
||||||
=> '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag'
|
=> '\Barryvdh\Reflection\DocBlock\Tag\VersionTag'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -366,14 +366,12 @@ class Tag implements \Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the exported information (we should use the export static method
|
* Returns the tag as a serialized string
|
||||||
* BUT this throws an exception at this point).
|
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @codeCoverageIgnore Not yet implemented
|
|
||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return 'Not yet implemented';
|
return "@{$this->getName()} {$this->getContent()}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for an @author tag in a Docblock.
|
* Reflection class for an @author tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @covers tag in a Docblock.
|
* Reflection class for a @covers tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
|
use Barryvdh\Reflection\DocBlock\Tag\VersionTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @deprecated tag in a Docblock.
|
* Reflection class for a @deprecated tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @example tag in a Docblock.
|
* Reflection class for a @example tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @link tag in a Docblock.
|
* Reflection class for a @link tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @method in a Docblock.
|
* Reflection class for a @method in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @param tag in a Docblock.
|
* Reflection class for a @param tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @property-read tag in a Docblock.
|
* Reflection class for a @property-read tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @property tag in a Docblock.
|
* Reflection class for a @property tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @property-write tag in a Docblock.
|
* Reflection class for a @property-write tag in a Docblock.
|
||||||
+33
-4
@@ -10,10 +10,10 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
use phpDocumentor\Reflection\DocBlock\Type\Collection;
|
use Barryvdh\Reflection\DocBlock\Type\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @return tag in a Docblock.
|
* Reflection class for a @return tag in a Docblock.
|
||||||
@@ -36,7 +36,7 @@ class ReturnTag extends Tag
|
|||||||
public function getContent()
|
public function getContent()
|
||||||
{
|
{
|
||||||
if (null === $this->content) {
|
if (null === $this->content) {
|
||||||
$this->content = "{$this->type} {$this->description}";
|
$this->content = "{$this->getType()} {$this->description}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->content;
|
return $this->content;
|
||||||
@@ -81,6 +81,35 @@ class ReturnTag extends Tag
|
|||||||
return (string) $this->getTypesCollection();
|
return (string) $this->getTypesCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type section of the variable
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setType($type)
|
||||||
|
{
|
||||||
|
$this->type = $type;
|
||||||
|
$this->types = null;
|
||||||
|
$this->content = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a type to the type section of the variable
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function addType($type)
|
||||||
|
{
|
||||||
|
$this->type = $this->type . Collection::OPERATOR_OR . $type;
|
||||||
|
$this->types = null;
|
||||||
|
$this->content = null;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type collection.
|
* Returns the type collection.
|
||||||
*
|
*
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @see tag in a Docblock.
|
* Reflection class for a @see tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
|
use Barryvdh\Reflection\DocBlock\Tag\VersionTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @since tag in a Docblock.
|
* Reflection class for a @since tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @source tag in a Docblock.
|
* Reflection class for a @source tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @throws tag in a Docblock.
|
* Reflection class for a @throws tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @uses tag in a Docblock.
|
* Reflection class for a @uses tag in a Docblock.
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @var tag in a Docblock.
|
* Reflection class for a @var tag in a Docblock.
|
||||||
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use Barryvdh\Reflection\DocBlock\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflection class for a @version tag in a Docblock.
|
* Reflection class for a @version tag in a Docblock.
|
||||||
+19
-2
@@ -10,9 +10,9 @@
|
|||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Type;
|
namespace Barryvdh\Reflection\DocBlock\Type;
|
||||||
|
|
||||||
use phpDocumentor\Reflection\DocBlock\Context;
|
use Barryvdh\Reflection\DocBlock\Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collection
|
* Collection
|
||||||
@@ -156,6 +156,11 @@ class Collection extends \ArrayObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
|
if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
|
||||||
|
|
||||||
|
if($this->shouldBeAbsolute($type)){
|
||||||
|
return self::OPERATOR_NAMESPACE . $type;
|
||||||
|
}
|
||||||
|
|
||||||
$type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2);
|
$type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2);
|
||||||
|
|
||||||
$namespace_aliases = $this->context->getNamespaceAliases();
|
$namespace_aliases = $this->context->getNamespaceAliases();
|
||||||
@@ -218,4 +223,16 @@ class Collection extends \ArrayObject
|
|||||||
return ($type[0] !== self::OPERATOR_NAMESPACE)
|
return ($type[0] !== self::OPERATOR_NAMESPACE)
|
||||||
|| $this->isTypeAKeyword($type);
|
|| $this->isTypeAKeyword($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detects if the type should actually be absolute, by checking if it exists.
|
||||||
|
*
|
||||||
|
* @param string $type A relative or absolute type as defined in the
|
||||||
|
* phpDocumentor documentation.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function shouldBeAbsolute($type){
|
||||||
|
return class_exists($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user