mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d93f42598 | ||
|
|
eb83d810de | ||
|
|
6f0fc03c49 | ||
|
|
b09525332f | ||
|
|
c2796044a6 |
@@ -1,4 +1,4 @@
|
||||
The ReflectionDocBlock Component
|
||||
The ReflectionDocBlock Component [](https://travis-ci.org/phpDocumentor/ReflectionDocBlock)
|
||||
================================
|
||||
|
||||
Introduction
|
||||
@@ -7,7 +7,7 @@ Introduction
|
||||
The ReflectionDocBlock component of phpDocumentor provides a DocBlock parser
|
||||
that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest).
|
||||
|
||||
With this component can a library provide support for annotations via DocBlocks
|
||||
With this component, a library can provide support for annotations via DocBlocks
|
||||
or otherwise retrieve information that is embedded in a DocBlock.
|
||||
|
||||
> **Note**: *this is a core component of phpDocumentor and is constantly being
|
||||
|
||||
+2
-2
@@ -6,13 +6,13 @@
|
||||
{"name": "Mike van Riel", "email": "[email protected]"}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.2",
|
||||
"php": ">=5.3.3",
|
||||
"dflydev/markdown": "1.0.*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {"phpDocumentor": ["src/"]}
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "*@stable"
|
||||
"phpunit/phpunit": "3.7.*@stable"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+413
-5
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"hash": "89c7387ec02d39de3c07849e525f95e4",
|
||||
"hash": "c6115c20a4a284f6ca14e676e788b4d3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "dflydev/markdown",
|
||||
@@ -26,6 +26,7 @@
|
||||
"dflydev\\markdown": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"New BSD License"
|
||||
],
|
||||
@@ -56,12 +57,419 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"packages-dev": null,
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "1.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "1.2.7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage/archive/1.2.7.zip",
|
||||
"reference": "1.2.7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-file-iterator": ">=1.3.0@stable",
|
||||
"phpunit/php-token-stream": ">=1.1.3@stable",
|
||||
"phpunit/php-text-template": ">=1.1.1@stable"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "*",
|
||||
"ext-xdebug": ">=2.0.5"
|
||||
},
|
||||
"time": "2012-12-02 14:54:55",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHP/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
|
||||
"keywords": [
|
||||
"testing",
|
||||
"coverage",
|
||||
"xunit"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
"version": "1.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/php-file-iterator.git",
|
||||
"reference": "1.3.3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3",
|
||||
"reference": "1.3.3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2012-10-11 04:44:38",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"File/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
|
||||
"homepage": "http://www.phpunit.de/",
|
||||
"keywords": [
|
||||
"filesystem",
|
||||
"iterator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-text-template",
|
||||
"version": "1.1.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/php-text-template.git",
|
||||
"reference": "1.1.4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4",
|
||||
"reference": "1.1.4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2012-10-31 11:15:28",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"Text/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Simple template engine.",
|
||||
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
||||
"keywords": [
|
||||
"template"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-timer",
|
||||
"version": "1.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/php-timer.git",
|
||||
"reference": "1.0.4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4",
|
||||
"reference": "1.0.4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2012-10-11 04:45:58",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHP/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Utility class for timing",
|
||||
"homepage": "http://www.phpunit.de/",
|
||||
"keywords": [
|
||||
"timer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-token-stream",
|
||||
"version": "1.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/php-token-stream.git",
|
||||
"reference": "1.1.5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5",
|
||||
"reference": "1.1.5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-tokenizer": "*",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2012-10-11 04:47:14",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHP/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Wrapper around PHP's tokenizer extension.",
|
||||
"homepage": "http://www.phpunit.de/",
|
||||
"keywords": [
|
||||
"tokenizer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "3.7.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "3.7.10"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.10.zip",
|
||||
"reference": "3.7.10",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-file-iterator": ">=1.3.1",
|
||||
"phpunit/php-text-template": ">=1.1.1",
|
||||
"phpunit/php-code-coverage": ">=1.2.1",
|
||||
"phpunit/php-timer": ">=1.0.2",
|
||||
"phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0",
|
||||
"symfony/yaml": ">=2.1.0",
|
||||
"ext-dom": "*",
|
||||
"ext-pcre": "*",
|
||||
"ext-reflection": "*",
|
||||
"ext-spl": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-invoker": ">=1.1.0",
|
||||
"ext-json": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-tokenizer": "*"
|
||||
},
|
||||
"time": "2012-12-02 14:56:55",
|
||||
"bin": [
|
||||
"composer/bin/phpunit"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.7.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHPUnit/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
"",
|
||||
"../../symfony/yaml/"
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "The PHP Unit Testing framework.",
|
||||
"homepage": "http://www.phpunit.de/",
|
||||
"keywords": [
|
||||
"testing",
|
||||
"phpunit",
|
||||
"xunit"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "1.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "1.2.2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.2.zip",
|
||||
"reference": "1.2.2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"phpunit/php-text-template": ">=1.1.1@stable"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-soap": "*"
|
||||
},
|
||||
"time": "2012-11-05 10:39:13",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHPUnit/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "[email protected]",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Mock Object library for PHPUnit",
|
||||
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
||||
"keywords": [
|
||||
"mock",
|
||||
"xunit"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v2.1.4",
|
||||
"target-dir": "Symfony/Component/Yaml",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Yaml",
|
||||
"reference": "v2.1.4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip",
|
||||
"reference": "v2.1.4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2012-11-08 09:51:48",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Yaml": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "[email protected]"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "http://symfony.com"
|
||||
}
|
||||
],
|
||||
"aliases": [
|
||||
|
||||
],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [
|
||||
|
||||
]
|
||||
"stability-flags": {
|
||||
"phpunit/phpunit": 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace phpDocumentor\Reflection;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
use phpDocumentor\Reflection\DocBlock\Context;
|
||||
use phpDocumentor\Reflection\DocBlock\Location;
|
||||
|
||||
@@ -28,13 +29,13 @@ class DocBlock implements \Reflector
|
||||
protected $short_description = '';
|
||||
|
||||
/**
|
||||
* @var \phpDocumentor\Reflection\DocBlock\LongDescription The actual
|
||||
* @var DocBlock\Description The actual
|
||||
* description for this docblock.
|
||||
*/
|
||||
protected $long_description = null;
|
||||
|
||||
/**
|
||||
* @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all
|
||||
* @var Tag[] An array containing all
|
||||
* the tags in this docblock; except inline.
|
||||
*/
|
||||
protected $tags = array();
|
||||
@@ -221,7 +222,7 @@ class DocBlock implements \Reflector
|
||||
|
||||
// create proper Tag objects
|
||||
foreach ($result as $key => $tag_line) {
|
||||
$result[$key] = DocBlock\Tag::createInstance($tag_line, $this);
|
||||
$result[$key] = Tag::createInstance($tag_line, $this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +242,7 @@ class DocBlock implements \Reflector
|
||||
/**
|
||||
* Returns the full description or also known as long description.
|
||||
*
|
||||
* @return \phpDocumentor\Reflection\DocBlock\LongDescription
|
||||
* @return DocBlock\Description
|
||||
*/
|
||||
public function getLongDescription()
|
||||
{
|
||||
@@ -271,7 +272,7 @@ class DocBlock implements \Reflector
|
||||
/**
|
||||
* Returns the tags for this DocBlock.
|
||||
*
|
||||
* @return \phpDocumentor\Reflection\DocBlock\Tag[]
|
||||
* @return Tag[]
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
@@ -284,13 +285,13 @@ class DocBlock implements \Reflector
|
||||
*
|
||||
* @param string $name String to search by.
|
||||
*
|
||||
* @return \phpDocumentor\Reflection\DocBlock_Tag[]
|
||||
* @return Tag[]
|
||||
*/
|
||||
public function getTagsByName($name)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
/** @var \phpDocumentor\Reflection\DocBlock\Tag $tag */
|
||||
/** @var Tag $tag */
|
||||
foreach ($this->getTags() as $tag) {
|
||||
if ($tag->getName() != $name) {
|
||||
continue;
|
||||
@@ -311,7 +312,7 @@ class DocBlock implements \Reflector
|
||||
*/
|
||||
public function hasTag($name)
|
||||
{
|
||||
/** @var \phpDocumentor\Reflection\DocBlock\Tag $tag */
|
||||
/** @var Tag $tag */
|
||||
foreach ($this->getTags() as $tag) {
|
||||
if ($tag->getName() == $name) {
|
||||
return true;
|
||||
@@ -321,6 +322,32 @@ class DocBlock implements \Reflector
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a tag at the end of the list of tags.
|
||||
*
|
||||
* @param Tag $tag The tag to add.
|
||||
*
|
||||
* @return Tag The newly added tag.
|
||||
*
|
||||
* @throws \LogicException When the tag belongs to a different DocBlock.
|
||||
*/
|
||||
public function appendTag(Tag $tag)
|
||||
{
|
||||
if (null === $tag->getDocBlock()) {
|
||||
$tag->setDocBlock($this);
|
||||
}
|
||||
|
||||
if ($tag->getDocBlock() === $this) {
|
||||
$this->tags[] = $tag;
|
||||
} else {
|
||||
throw new \LogicException(
|
||||
'This tag belongs to a different DocBlock object.'
|
||||
);
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a string representation of this object.
|
||||
*
|
||||
|
||||
@@ -29,26 +29,22 @@ class Description implements \Reflector
|
||||
/** @var array The contents, as an array of strings and Tag objects. */
|
||||
protected $parsedContents = null;
|
||||
|
||||
/** @var \phpDocumentor\Reflection\DocBlock\Tags[] */
|
||||
protected $tags = array();
|
||||
|
||||
/** @var DocBlock The DocBlock which this description belongs to. */
|
||||
protected $docblock = null;
|
||||
|
||||
/**
|
||||
* Populates the fields of a description.
|
||||
*
|
||||
* @param string $content The DocBlock contents without asterisks.
|
||||
* @param string $content The description's conetnts.
|
||||
* @param DocBlock $docblock The DocBlock which this description belongs to.
|
||||
*/
|
||||
public function __construct($content, DocBlock $docblock = null)
|
||||
{
|
||||
$this->contents = trim($content);
|
||||
$this->docblock = $docblock;
|
||||
$this->setContent($content)->setDocBlock($docblock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text of this description.
|
||||
* Gets the text of this description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -57,6 +53,21 @@ class Description implements \Reflector
|
||||
return $this->contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text of this description.
|
||||
*
|
||||
* @param string $content The new text of this description.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
$this->contents = trim($content);
|
||||
|
||||
$this->parsedContents = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parsed text of this description.
|
||||
*
|
||||
@@ -101,7 +112,9 @@ class Description implements \Reflector
|
||||
null,
|
||||
PREG_SPLIT_DELIM_CAPTURE
|
||||
);
|
||||
for ($i=1, $l = count($this->parsedContents); $i<$l; $i += 2) {
|
||||
|
||||
$count = count($this->parsedContents);
|
||||
for ($i=1; $i<$count; $i += 2) {
|
||||
$this->parsedContents[$i] = Tag::createInstance(
|
||||
$this->parsedContents[$i],
|
||||
$this->docblock
|
||||
@@ -111,7 +124,7 @@ class Description implements \Reflector
|
||||
//In order to allow "literal" inline tags, the otherwise invalid
|
||||
//sequence "{@}" is changed to "@", and "{}" is changed to "}".
|
||||
//See unit tests for examples.
|
||||
for ($i=0, $l = count($this->parsedContents); $i<$l; $i += 2) {
|
||||
for ($i=0; $i<$count; $i += 2) {
|
||||
$this->parsedContents[$i] = str_replace(
|
||||
array('{@}', '{}'),
|
||||
array('@', '}'),
|
||||
@@ -156,6 +169,31 @@ class Description implements \Reflector
|
||||
return trim($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the docblock this tag belongs to.
|
||||
*
|
||||
* @return DocBlock The docblock this description belongs to.
|
||||
*/
|
||||
public function getDocBlock()
|
||||
{
|
||||
return $this->docblock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the docblock this tag belongs to.
|
||||
*
|
||||
* @param DocBlock $docblock The new docblock this description belongs to.
|
||||
* Setting NULL removes any association.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDocBlock(DocBlock $docblock = null)
|
||||
{
|
||||
$this->docblock = $docblock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a string representation of this object.
|
||||
*
|
||||
|
||||
@@ -22,17 +22,16 @@ namespace phpDocumentor\Reflection\DocBlock;
|
||||
class Location
|
||||
{
|
||||
/** @var int Line where the DocBlock text starts. */
|
||||
protected $line_number = 0;
|
||||
protected $lineNumber = 0;
|
||||
|
||||
/** @var int Column where the DocBlock text starts. */
|
||||
protected $column_number = 0;
|
||||
protected $columnNumber = 0;
|
||||
|
||||
public function __construct(
|
||||
$line_number = 0,
|
||||
$column_number = 0
|
||||
$lineNumber = 0,
|
||||
$columnNumber = 0
|
||||
) {
|
||||
$this->line_number = (int)$line_number;
|
||||
$this->column_number = (int)$column_number;
|
||||
$this->setLineNumber($lineNumber)->setColumnNumber($columnNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,19 @@ class Location
|
||||
*/
|
||||
public function getLineNumber()
|
||||
{
|
||||
return $this->line_number;
|
||||
return $this->lineNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $lineNumber
|
||||
* @return $this
|
||||
*/
|
||||
public function setLineNumber($lineNumber)
|
||||
{
|
||||
$this->lineNumber = (int)$lineNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,6 +59,18 @@ class Location
|
||||
*/
|
||||
public function getColumnNumber()
|
||||
{
|
||||
return $this->column_number;
|
||||
return $this->columnNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $columnNumber
|
||||
* @return $this
|
||||
*/
|
||||
public function setColumnNumber($columnNumber)
|
||||
{
|
||||
$this->columnNumber = (int)$columnNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,27 @@ use phpDocumentor\Reflection\DocBlock;
|
||||
*/
|
||||
class Tag implements \Reflector
|
||||
{
|
||||
/**
|
||||
* PCRE regular expression matching a tag name.
|
||||
*/
|
||||
const REGEX_TAGNAME = '[\w\-\_\\\\]+';
|
||||
|
||||
/** @var string Name of the tag */
|
||||
protected $tag = '';
|
||||
|
||||
/** @var string Content of the tag */
|
||||
/**
|
||||
* @var string|null Content of the tag.
|
||||
* When set to NULL, it means it needs to be regenerated.
|
||||
*/
|
||||
protected $content = '';
|
||||
|
||||
/** @var string Description of the content of this tag */
|
||||
protected $description = '';
|
||||
|
||||
/** @var array The description, as an array of strings and Tag objects. */
|
||||
/**
|
||||
* @var array|null The description, as an array of strings and Tag objects.
|
||||
* When set to NULL, it means it needs to be regenerated.
|
||||
*/
|
||||
protected $parsedDescription = null;
|
||||
|
||||
/** @var Location Location of the tag. */
|
||||
@@ -104,7 +115,7 @@ class Tag implements \Reflector
|
||||
Location $location = null
|
||||
) {
|
||||
if (!preg_match(
|
||||
'/^@([\w\-\_\\\\]+)(?:\s*([^\s].*)|$)?/us',
|
||||
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
|
||||
$tag_line,
|
||||
$matches
|
||||
)) {
|
||||
@@ -173,28 +184,28 @@ class Tag implements \Reflector
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Name of the tag.
|
||||
* @param string $name Name of the tag.
|
||||
* @param string $content The contents of the given tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$name,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
$this->tag = $type;
|
||||
$this->content = $content;
|
||||
$this->description = trim($content);
|
||||
$this->docblock = $docblock;
|
||||
$this->location = $location;
|
||||
$this
|
||||
->setName($name)
|
||||
->setContent($content)
|
||||
->setDocBlock($docblock)
|
||||
->setLocation($location);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of this tag.
|
||||
* Gets the name of this tag.
|
||||
*
|
||||
* @return string
|
||||
* @return string The name of this tag.
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -202,17 +213,57 @@ class Tag implements \Reflector
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content of this tag.
|
||||
* Sets the name of this tag.
|
||||
*
|
||||
* @param string $name The new name of this tag.
|
||||
*
|
||||
* @return $this
|
||||
* @throws \InvalidArgumentException When an invalid tag name is provided.
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Invalid tag name supplied: ' . $name
|
||||
);
|
||||
}
|
||||
|
||||
$this->tag = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the content of this tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = $this->description;
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description component of this tag.
|
||||
* Sets the content of this tag.
|
||||
*
|
||||
* @param string $content The new content of this tag.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
$this->setDescription($content);
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description component of this tag.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -222,7 +273,23 @@ class Tag implements \Reflector
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parsed text of this description.
|
||||
* Sets the description component of this tag.
|
||||
*
|
||||
* @param string $description The new description component of this tag.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->content = null;
|
||||
$this->parsedDescription = null;
|
||||
$this->description = trim($description);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parsed text of this description.
|
||||
*
|
||||
* @return array An array of strings and tag objects, in the order they
|
||||
* occur within the description.
|
||||
@@ -237,15 +304,54 @@ class Tag implements \Reflector
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location of the tag.
|
||||
* Gets the docblock this tag belongs to.
|
||||
*
|
||||
* @return Location Tag's location.
|
||||
* @return DocBlock The docblock this tag belongs to.
|
||||
*/
|
||||
public function getDocBlock()
|
||||
{
|
||||
return $this->docblock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the docblock this tag belongs to.
|
||||
*
|
||||
* @param DocBlock $docblock The new docblock this tag belongs to. Setting
|
||||
* NULL removes any association.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDocBlock(DocBlock $docblock = null)
|
||||
{
|
||||
$this->docblock = $docblock;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location of the tag.
|
||||
*
|
||||
* @return Location The tag's location.
|
||||
*/
|
||||
public function getLocation()
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location of the tag.
|
||||
*
|
||||
* @param Location $location The new location of the tag.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocation(Location $location = null)
|
||||
{
|
||||
$this->location = $location;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a string representation of this object.
|
||||
*
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -24,37 +23,54 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
*/
|
||||
class AuthorTag extends Tag
|
||||
{
|
||||
/** @var string The name of the author */
|
||||
protected $name = '';
|
||||
|
||||
/** @var string The email of the author */
|
||||
protected $email = '';
|
||||
/**
|
||||
* PCRE regular expression matching any valid value for the name component.
|
||||
*/
|
||||
const REGEX_AUTHOR_NAME = '[^\<]*';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'author').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* PCRE regular expression matching any valid value for the email component.
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
const REGEX_AUTHOR_EMAIL = '[^\>]*';
|
||||
|
||||
/** @var string The name of the author */
|
||||
protected $authorName = '';
|
||||
|
||||
/** @var string The email of the author */
|
||||
protected $authorEmail = '';
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = $this->authorName;
|
||||
if ('' != $this->authorEmail) {
|
||||
$this->content .= "<{$this->authorEmail}>";
|
||||
}
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
if (preg_match(
|
||||
'/^([^\<]*)(\<([^\>]*)\>)?$/',
|
||||
'/^(' . self::REGEX_AUTHOR_NAME .
|
||||
')(\<(' . self::REGEX_AUTHOR_EMAIL .
|
||||
')\>)?$/u',
|
||||
$this->description,
|
||||
$matches
|
||||
)) {
|
||||
$this->name = trim($matches[1]);
|
||||
$this->authorName = trim($matches[1]);
|
||||
if (isset($matches[3])) {
|
||||
$this->email = trim($matches[3]);
|
||||
$this->authorEmail = trim($matches[3]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +80,25 @@ class AuthorTag extends Tag
|
||||
*/
|
||||
public function getAuthorName()
|
||||
{
|
||||
return $this->name;
|
||||
return $this->authorName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the author's name.
|
||||
*
|
||||
* @param string $authorName The new author name.
|
||||
* An invalid value will set an empty string.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthorName($authorName)
|
||||
{
|
||||
$this->content = null;
|
||||
$this->authorName
|
||||
= preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName)
|
||||
? $authorName : '';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,6 +108,24 @@ class AuthorTag extends Tag
|
||||
*/
|
||||
public function getAuthorEmail()
|
||||
{
|
||||
return $this->email;
|
||||
return $this->authorEmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the author's email.
|
||||
*
|
||||
* @param string $authorEmail The new author email.
|
||||
* An invalid value will set an empty string.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthorEmail($authorEmail)
|
||||
{
|
||||
$this->authorEmail
|
||||
= preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail)
|
||||
? $authorEmail : '';
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -24,26 +23,53 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
*/
|
||||
class ExampleTag extends SourceTag
|
||||
{
|
||||
/** @var string Path to a file to use as an example. Can also be an URI. */
|
||||
/**
|
||||
* @var string Path to a file to use as an example.
|
||||
* May also be an absolute URI.
|
||||
*/
|
||||
protected $filePath = '';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'example').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* @var bool Whether the file path component represents an URI.
|
||||
* This determines how the file portion appears at {@link getContent()}.
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
Tag::__construct($type, $content, $docblock, $location);
|
||||
protected $isURI = false;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$filePath = '';
|
||||
if ($this->isURI) {
|
||||
if (false === strpos($this->filePath, ':')) {
|
||||
$filePath = str_replace(
|
||||
'%2F',
|
||||
'/',
|
||||
rawurlencode($this->filePath)
|
||||
);
|
||||
} else {
|
||||
$filePath = $this->filePath;
|
||||
}
|
||||
} else {
|
||||
$filePath = '"' . $this->filePath . '"';
|
||||
}
|
||||
|
||||
$this->content = $filePath . ' ' . $this->getContent();
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
Tag::setContent($content);
|
||||
if (preg_match(
|
||||
'/^
|
||||
# File component
|
||||
(?:
|
||||
# File path in quotes
|
||||
\"([^\"]+)\"
|
||||
@@ -58,34 +84,73 @@ class ExampleTag extends SourceTag
|
||||
$matches
|
||||
)) {
|
||||
if ('' !== $matches[1]) {
|
||||
//Quoted file path.
|
||||
$this->filePath = trim($matches[1]);
|
||||
} elseif (false === strpos($matches[2], ':')) {
|
||||
//Relative URL or a file path with no spaces in it.
|
||||
$this->filePath = rawurldecode(
|
||||
str_replace(array('/', '\\'), '%2F', $matches[2])
|
||||
);
|
||||
$this->setFilePath($matches[1]);
|
||||
} else {
|
||||
//Absolute URL or URI.
|
||||
$this->filePath = $matches[2];
|
||||
$this->setFileURI($matches[2]);
|
||||
}
|
||||
|
||||
if (isset($matches[3])) {
|
||||
parent::__construct($type, $matches[3]);
|
||||
$this->content = $content;
|
||||
parent::setContent($matches[3]);
|
||||
} else {
|
||||
$this->description = '';
|
||||
$this->setDescription('');
|
||||
}
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file path.
|
||||
*
|
||||
* @return string Path to a file to use as an example. Can also be an URI.
|
||||
* @return string Path to a file to use as an example.
|
||||
* May also be an absolute URI.
|
||||
*/
|
||||
public function getFilePath()
|
||||
{
|
||||
return $this->filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file path.
|
||||
*
|
||||
* @param string $filePath The new file path to use for the example.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFilePath($filePath)
|
||||
{
|
||||
$this->isURI = false;
|
||||
$this->filePath = trim($filePath);
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the file path as an URI.
|
||||
*
|
||||
* This function is equivalent to {@link setFilePath()}, except that it
|
||||
* convers an URI to a file path before that.
|
||||
*
|
||||
* There is no getFileURI(), as {@link getFilePath()} is compatible.
|
||||
*
|
||||
* @param type $uri The new file URI to use as an example.
|
||||
*/
|
||||
public function setFileURI($uri)
|
||||
{
|
||||
$this->isURI = true;
|
||||
if (false === strpos($uri, ':')) {
|
||||
//Relative URL
|
||||
$this->filePath = rawurldecode(
|
||||
str_replace(array('/', '\\'), '%2F', $uri)
|
||||
);
|
||||
} else {
|
||||
//Absolute URL or URI.
|
||||
$this->filePath = $uri;
|
||||
}
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -28,30 +27,35 @@ class LinkTag extends Tag
|
||||
protected $link = '';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'link').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
$content = preg_split('/\s+/u', $this->description, 2);
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = "{$this->link} {$this->description}";
|
||||
}
|
||||
|
||||
// any output is considered a type
|
||||
$this->link = $content[0];
|
||||
|
||||
$this->description = isset($content[1]) ? $content[1] : $content[0];
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the link
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
$parts = preg_split('/\s+/Su', $this->description, 2);
|
||||
|
||||
$this->link = $parts[0];
|
||||
|
||||
$this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]);
|
||||
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the link
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -65,10 +69,13 @@ class LinkTag extends Tag
|
||||
*
|
||||
* @param string $link The link
|
||||
*
|
||||
* @return void
|
||||
* @return $this
|
||||
*/
|
||||
public function setLink($link)
|
||||
{
|
||||
$this->link = $link;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -32,22 +31,25 @@ class MethodTag extends ReturnTag
|
||||
protected $arguments = '';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'method').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
Tag::__construct($type, $content, $docblock, $location);
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = $this->type .
|
||||
" {$this->method_name}({$this->arguments}) " .
|
||||
$this->description;
|
||||
}
|
||||
|
||||
$matches = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
Tag::setContent($content);
|
||||
// 1. none or more whitespace
|
||||
// 2. optionally a word with underscores followed by whitespace : as
|
||||
// type for the return value
|
||||
@@ -88,10 +90,13 @@ class MethodTag extends ReturnTag
|
||||
if (!$this->type) {
|
||||
$this->type = 'void';
|
||||
}
|
||||
$this->parsedDescription = null;
|
||||
} else {
|
||||
echo date('c') . ' ERR (3): @method contained invalid contents: '
|
||||
. $this->content . PHP_EOL;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,11 +104,14 @@ class MethodTag extends ReturnTag
|
||||
*
|
||||
* @param string $method_name The name of the method.
|
||||
*
|
||||
* @return void
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethodName($method_name)
|
||||
{
|
||||
$this->method_name = $method_name;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,6 +134,9 @@ class MethodTag extends ReturnTag
|
||||
public function setArguments($arguments)
|
||||
{
|
||||
$this->arguments = $arguments;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -27,49 +26,54 @@ class ParamTag extends ReturnTag
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $variableName = null;
|
||||
protected $variableName = '';
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'param').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
Tag::__construct($type, $content, $docblock, $location);
|
||||
$content = preg_split(
|
||||
'/(\s+)/u',
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content
|
||||
= "{$this->type} {$this->variableName} {$this->description}";
|
||||
}
|
||||
return $this->content;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
Tag::setContent($content);
|
||||
$parts = preg_split(
|
||||
'/(\s+)/Su',
|
||||
$this->description,
|
||||
3,
|
||||
PREG_SPLIT_DELIM_CAPTURE
|
||||
);
|
||||
|
||||
// if the first item that is encountered is not a variable; it is a type
|
||||
if (isset($content[0])
|
||||
&& (strlen($content[0]) > 0)
|
||||
&& ($content[0][0] !== '$')
|
||||
if (isset($parts[0])
|
||||
&& (strlen($parts[0]) > 0)
|
||||
&& ($parts[0][0] !== '$')
|
||||
) {
|
||||
$this->type = array_shift($content);
|
||||
array_shift($content);
|
||||
$this->type = array_shift($parts);
|
||||
array_shift($parts);
|
||||
}
|
||||
|
||||
// if the next item starts with a $ it must be the variable name
|
||||
if (isset($content[0])
|
||||
&& (strlen($content[0]) > 0)
|
||||
&& ($content[0][0] == '$')
|
||||
if (isset($parts[0])
|
||||
&& (strlen($parts[0]) > 0)
|
||||
&& ($parts[0][0] == '$')
|
||||
) {
|
||||
$this->variableName = array_shift($content);
|
||||
array_shift($content);
|
||||
$this->variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
}
|
||||
|
||||
$this->description = implode('', $content);
|
||||
$this->setDescription(implode('', $parts));
|
||||
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,10 +91,13 @@ class ParamTag extends ReturnTag
|
||||
*
|
||||
* @param string $name The new name for this variable.
|
||||
*
|
||||
* @return void
|
||||
* @return $this
|
||||
*/
|
||||
public function setVariableName($name)
|
||||
{
|
||||
$this->variableName = $name;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
use phpDocumentor\Reflection\DocBlock\Type\Collection;
|
||||
|
||||
@@ -32,26 +31,33 @@ class ReturnTag extends Tag
|
||||
protected $types = null;
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'return').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
$content = preg_split('/\s+/u', $this->description, 2);
|
||||
public function getCotnent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = "{$this->type} {$this->description}";
|
||||
}
|
||||
|
||||
return $this->cotnent;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
|
||||
$parts = preg_split('/\s+/Su', $this->description, 2);
|
||||
|
||||
// any output is considered a type
|
||||
$this->type = $content[0];
|
||||
$this->type = $parts[0];
|
||||
|
||||
$this->description = isset($content[1]) ? $content[1] : '';
|
||||
$this->setDescription(isset($parts[1]) ? $parts[1] : '');
|
||||
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -28,30 +27,35 @@ class SeeTag extends Tag
|
||||
protected $refers = null;
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'see').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
$content = preg_split('/\s+/u', $this->description, 2);
|
||||
|
||||
// any output is considered a type
|
||||
$this->refers = $content[0];
|
||||
|
||||
$this->description = isset($content[1]) ? $content[1] : '';
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = "{$this->refers} {$this->description}";
|
||||
}
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of the variable.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
$parts = preg_split('/\s+/Su', $this->description, 2);
|
||||
|
||||
// any output is considered a type
|
||||
$this->refers = $parts[0];
|
||||
|
||||
$this->setDescription(isset($parts[1]) ? $parts[1] : '');
|
||||
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the structural element this tag refers to.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -59,4 +63,19 @@ class SeeTag extends Tag
|
||||
{
|
||||
return $this->refers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the structural element this tag refers to.
|
||||
*
|
||||
* @param string $refers The new type this tag refers to.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReference($refers)
|
||||
{
|
||||
$this->refers = $refers;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,20 +36,24 @@ class SourceTag extends Tag
|
||||
protected $lineCount = null;
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'source').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content
|
||||
= "{$this->startingLine} {$this->lineCount} {$this->description}";
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
if (preg_match(
|
||||
'/^
|
||||
# Starting line
|
||||
@@ -70,12 +74,15 @@ class SourceTag extends Tag
|
||||
if (isset($matches[2]) && '' !== $matches[2]) {
|
||||
$this->lineCount = (int)$matches[2];
|
||||
}
|
||||
$this->description = $matches[3];
|
||||
$this->setDescription($matches[3]);
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the starting line.
|
||||
* Gets the starting line.
|
||||
*
|
||||
* @return int The starting line, relative to the structural element's
|
||||
* location.
|
||||
@@ -85,6 +92,22 @@ class SourceTag extends Tag
|
||||
return $this->startingLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the starting line.
|
||||
*
|
||||
* @param int $startingLine The new starting line, relative to the
|
||||
* structural element's location.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartingLine($startingLine)
|
||||
{
|
||||
$this->startingLine = $startingLine;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of lines.
|
||||
*
|
||||
@@ -95,4 +118,20 @@ class SourceTag extends Tag
|
||||
{
|
||||
return $this->lineCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of lines.
|
||||
*
|
||||
* @param int|null $lineCount The new number of lines, relative to the
|
||||
* starting line. NULL means "to the end".
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLineCount($lineCount)
|
||||
{
|
||||
$this->lineCount = $lineCount;
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
* Reflection class for a @var tag in a Docblock.
|
||||
*
|
||||
@@ -24,38 +21,4 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
*/
|
||||
class VarTag extends ParamTag
|
||||
{
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'var').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
Tag::__construct($type, $content, $docblock, $location);
|
||||
$content = preg_split('/\s+/u', $this->description);
|
||||
|
||||
if (count($content) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// var always starts with the variable name
|
||||
$this->type = array_shift($content);
|
||||
|
||||
// if the next item starts with a $ it must be the variable name
|
||||
if ((count($content) > 0)
|
||||
&& (strlen($content[0]) > 0)
|
||||
&& ($content[0][0] == '$')
|
||||
) {
|
||||
$this->variableName = array_shift($content);
|
||||
}
|
||||
|
||||
$this->description = implode(' ', $content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
use phpDocumentor\Reflection\DocBlock;
|
||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
@@ -24,39 +23,45 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
||||
*/
|
||||
class VersionTag extends Tag
|
||||
{
|
||||
/**
|
||||
* PCRE regular expression matching a version vector.
|
||||
* Assumes the "x" modifier.
|
||||
*/
|
||||
const REGEX_VECTOR = '(?:
|
||||
# Normal release vectors.
|
||||
\d\S*
|
||||
|
|
||||
# VCS version vectors. Per PHPCS, they are expected to
|
||||
# follow the form of the VCS name, followed by ":", followed
|
||||
# by the version vector itself.
|
||||
# By convention, popular VCSes like CVS, SVN and GIT use "$"
|
||||
# around the actual version vector.
|
||||
[^\s\:]+\:\s*\$[^\$]+\$
|
||||
)';
|
||||
|
||||
/** @var string The version vector. */
|
||||
protected $version = '';
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
if (null === $this->content) {
|
||||
$this->content = "{$this->version} {$this->description}";
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a tag and populates the member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'version').
|
||||
* @param string $content Contents for this tag.
|
||||
* @param DocBlock $docblock The DocBlock which this tag belongs to.
|
||||
* @param Location $location Location of the tag.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(
|
||||
$type,
|
||||
$content,
|
||||
DocBlock $docblock = null,
|
||||
Location $location = null
|
||||
) {
|
||||
parent::__construct($type, $content, $docblock, $location);
|
||||
public function setContent($content)
|
||||
{
|
||||
parent::setContent($content);
|
||||
|
||||
if (preg_match(
|
||||
'/^
|
||||
# The version vector
|
||||
((?:
|
||||
# Normal release vectors.
|
||||
\d\S*
|
||||
|
|
||||
# VCS version vectors. Per PHPCS, they are expected to
|
||||
# follow the form of the VCS name, followed by ":", followed
|
||||
# by the version vector itself.
|
||||
# By convention, popular VCSes like CVS, SVN and GIT use "$"
|
||||
# around the actual version vector.
|
||||
[^\s\:]+\:\s*\$[^\$]+\$
|
||||
))
|
||||
(' . self::REGEX_VECTOR . ')
|
||||
\s*
|
||||
# The description
|
||||
(.+)?
|
||||
@@ -65,12 +70,15 @@ class VersionTag extends Tag
|
||||
$matches
|
||||
)) {
|
||||
$this->version = $matches[1];
|
||||
$this->description = isset($matches[2]) ? $matches[2] : '';
|
||||
$this->setDescription(isset($matches[2]) ? $matches[2] : '');
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version section of the tag.
|
||||
* Gets the version section of the tag.
|
||||
*
|
||||
* @return string The version section of the tag.
|
||||
*/
|
||||
@@ -78,4 +86,23 @@ class VersionTag extends Tag
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version section of the tag.
|
||||
*
|
||||
* @param string $version The new version section of the tag.
|
||||
* An invalid value will set an empty string.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setVersion($version)
|
||||
{
|
||||
$this->version
|
||||
= preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
|
||||
? $version
|
||||
: '';
|
||||
|
||||
$this->content = null;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ class Collection extends \ArrayObject
|
||||
const OPERATOR_NAMESPACE = '\\';
|
||||
|
||||
/** @var string[] List of recognized keywords */
|
||||
protected $keywords = array(
|
||||
protected static $keywords = array(
|
||||
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
|
||||
'object', 'mixed', 'array', 'resource', 'void', 'null',
|
||||
'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
|
||||
'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
|
||||
);
|
||||
|
||||
@@ -152,7 +152,7 @@ class Collection extends \ArrayObject
|
||||
}
|
||||
|
||||
if ($this->isTypeAnArray($type)) {
|
||||
return $this->expand(substr($type, 0, -2)).self::OPERATOR_ARRAY;
|
||||
return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY;
|
||||
}
|
||||
|
||||
if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
|
||||
@@ -186,7 +186,7 @@ class Collection extends \ArrayObject
|
||||
*/
|
||||
protected function isTypeAnArray($type)
|
||||
{
|
||||
return (substr($type, -2) == self::OPERATOR_ARRAY);
|
||||
return substr($type, -2) === self::OPERATOR_ARRAY;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +199,7 @@ class Collection extends \ArrayObject
|
||||
*/
|
||||
protected function isTypeAKeyword($type)
|
||||
{
|
||||
return in_array(strtolower($type), $this->keywords);
|
||||
return in_array(strtolower($type), static::$keywords, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,8 +33,7 @@ class ExampleTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exLineCount
|
||||
* @param string $exFilepath
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag::getFilePath
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -32,8 +32,7 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exDescription
|
||||
* @param string $exLink
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag::getLink
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -34,10 +34,7 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $description The short description mentioned in the
|
||||
* signature.
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag::getMethodName
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag::getArguments
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
|
||||
* @dataProvider getTestSignatures
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -33,9 +33,7 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $extractedVarName
|
||||
* @param string $extractedDescription
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag::getVariableName
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag
|
||||
* @dataProvider provideDataForConstructor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -33,7 +33,6 @@ class ReturnTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $extractedDescription
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag
|
||||
*
|
||||
* @dataProvider provideDataForConstructor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -31,8 +31,7 @@ class SeeTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exContent
|
||||
* @param string $exReference
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag::getReference
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -32,9 +32,7 @@ class SourceTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exStartingLine
|
||||
* @param string $exLineCount
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag::getStartingLine
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag::getLineCount
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -33,7 +33,6 @@ class ThrowsTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $extractedDescription
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag
|
||||
*
|
||||
* @dataProvider provideDataForConstructor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -32,7 +32,7 @@ class VarTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exVariable
|
||||
* @param string $exDescription
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -32,8 +32,7 @@ class VersionTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @param string $exDescription
|
||||
* @param string $exVersion
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag::getVersion
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
|
||||
@@ -272,9 +272,7 @@ TAG_HANDLER
|
||||
* @param string $content
|
||||
* @param string $exDescription
|
||||
*
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag::getDescription
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag::getContent
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tag
|
||||
* @dataProvider provideDataForConstuctor
|
||||
*
|
||||
* @return void
|
||||
@@ -309,11 +307,6 @@ TAG_HANDLER
|
||||
'unknown',
|
||||
'',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'',
|
||||
'unknown',
|
||||
'unknown',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user