mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Tons of coding standard fixes.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection;
|
|||||||
/**
|
/**
|
||||||
* Parses the DocBlock for any structure.
|
* Parses the DocBlock for any structure.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class DocBlock implements \Reflector
|
class DocBlock implements \Reflector
|
||||||
{
|
{
|
||||||
@@ -31,8 +31,8 @@ class DocBlock implements \Reflector
|
|||||||
protected $long_description = null;
|
protected $long_description = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all the tags
|
* @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all
|
||||||
* in this docblock; except inline.
|
* the tags in this docblock; except inline.
|
||||||
*/
|
*/
|
||||||
protected $tags = array();
|
protected $tags = array();
|
||||||
|
|
||||||
@@ -52,16 +52,16 @@ class DocBlock implements \Reflector
|
|||||||
* For example the param and return tags use this to expand their type
|
* For example the param and return tags use this to expand their type
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* @param \Reflector|string $docblock A docblock comment (including asterisks)
|
* @param \Reflector|string $docblock A docblock comment (including
|
||||||
* or reflector supporting the getDocComment method.
|
* asterisks) or reflector supporting the getDocComment method.
|
||||||
* @param string $namespace The namespace where this DocBlock resides in;
|
* @param string $namespace The namespace where this
|
||||||
* defaults to `\`.
|
* DocBlock resides in; defaults to `\`.
|
||||||
* @param string[] $namespace_aliases a list of namespace aliases as
|
* @param string[] $namespace_aliases A list of namespace aliases
|
||||||
* provided by the `use` keyword; the key of the array is the alias name
|
* as provided by the `use` keyword; the key of the array is the alias name
|
||||||
* or last part of the alias array if no alias name is provided.
|
* or last part of the alias array if no alias name is provided.
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException if the given argument does not have the
|
* @throws \InvalidArgumentException if the given argument does not have the
|
||||||
* getDocComment method.
|
* getDocComment method.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$docblock, $namespace = '\\', $namespace_aliases = array()
|
$docblock, $namespace = '\\', $namespace_aliases = array()
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock;
|
|||||||
/**
|
/**
|
||||||
* Parses a Long Description of a DocBlock.
|
* Parses a Long Description of a DocBlock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class LongDescription implements \Reflector
|
class LongDescription implements \Reflector
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ class LongDescription implements \Reflector
|
|||||||
return $this->contents;
|
return $this->contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Returns the parsed text of this description.
|
* Returns the parsed text of this description.
|
||||||
*
|
*
|
||||||
* @return array An array of strings and tag objects, in the order they
|
* @return array An array of strings and tag objects, in the order they
|
||||||
@@ -97,8 +97,8 @@ class LongDescription implements \Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (class_exists('dflydev\markdown\MarkdownExtraParser')) {
|
if (class_exists('dflydev\markdown\MarkdownExtraParser')) {
|
||||||
$md = new \dflydev\markdown\MarkdownExtraParser();
|
$markdown = new \dflydev\markdown\MarkdownExtraParser();
|
||||||
$result = $md->transformMarkdown($result);
|
$result = $markdown->transformMarkdown($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim($result);
|
return trim($result);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock;
|
|||||||
/**
|
/**
|
||||||
* Parses a tag definition for a DocBlock.
|
* Parses a tag definition for a DocBlock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class Tag implements \Reflector
|
class Tag implements \Reflector
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,7 @@ class Tag implements \Reflector
|
|||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Returns the parsed text of this description.
|
* Returns the parsed text of this description.
|
||||||
*
|
*
|
||||||
* @return array An array of strings and tag objects, in the order they
|
* @return array An array of strings and tag objects, in the order they
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <mike.vanriel@naenius.com>
|
* @author Vasil Rangelov <boen.robot@gmail.com>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
@@ -17,9 +17,9 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for an @author tag in a Docblock.
|
* Reflection class for an @author tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class AuthorTag extends Tag
|
class AuthorTag extends Tag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a @covers tag in a Docblock.
|
* Reflection class for a @covers tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class CoversTag extends SeeTag
|
class CoversTag extends SeeTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Ben Selby <[email protected]>
|
* @author Ben Selby <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -16,9 +16,9 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a @link tag in a Docblock.
|
* Reflection class for a @link tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Ben Selby <[email protected]>
|
* @author Ben Selby <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class LinkTag extends Tag
|
class LinkTag extends Tag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@method} in a Docblock.
|
* Reflection class for a {@method} in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class MethodTag extends ParamTag
|
class MethodTag extends ParamTag
|
||||||
{
|
{
|
||||||
@@ -49,8 +49,8 @@ class MethodTag extends ParamTag
|
|||||||
// until a ) and whitespace : as method name with signature
|
// until a ) and whitespace : as method name with signature
|
||||||
// 5. any remaining text : as description
|
// 5. any remaining text : as description
|
||||||
if (preg_match(
|
if (preg_match(
|
||||||
'/^[\s]*(?:([\w\|_\\\\]+)[\s]+)?(?:[\w_]+\(\)[\s]+)?([\w\|_\\\\]+)\(([^\)]*)\)'
|
'/^[\s]*(?:([\w\|_\\\\]+)[\s]+)?(?:[\w_]+\(\)[\s]+)?([\w\|_\\\\]+)'
|
||||||
.'[\s]*(.*)/u',
|
.'\(([^\)]*)\)[\s]*(.*)/u',
|
||||||
$content,
|
$content,
|
||||||
$matches
|
$matches
|
||||||
)) {
|
)) {
|
||||||
@@ -61,8 +61,7 @@ class MethodTag extends ParamTag
|
|||||||
$this->arguments,
|
$this->arguments,
|
||||||
$this->description
|
$this->description
|
||||||
) = $matches;
|
) = $matches;
|
||||||
if (!$this->type)
|
if (!$this->type) {
|
||||||
{
|
|
||||||
$this->type = 'void';
|
$this->type = 'void';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -16,9 +16,9 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@param} tag in a Docblock.
|
* Reflection class for a {@param} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ParamTag extends Tag
|
class ParamTag extends Tag
|
||||||
{
|
{
|
||||||
@@ -43,12 +43,18 @@ class ParamTag extends Tag
|
|||||||
$content = preg_split('/\s+/u', $content);
|
$content = preg_split('/\s+/u', $content);
|
||||||
|
|
||||||
// if the first item that is encountered is not a variable; it is a type
|
// 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($content[0])
|
||||||
|
&& (strlen($content[0]) > 0)
|
||||||
|
&& ($content[0][0] !== '$')
|
||||||
|
) {
|
||||||
$this->type = array_shift($content);
|
$this->type = array_shift($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the next item starts with a $ it must be the variable name
|
// 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($content[0])
|
||||||
|
&& (strlen($content[0]) > 0)
|
||||||
|
&& ($content[0][0] == '$')
|
||||||
|
) {
|
||||||
$this->variableName = array_shift($content);
|
$this->variableName = array_shift($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@property} tag in a Docblock.
|
* Reflection class for a {@property} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class PropertyReadTag extends PropertyTag
|
class PropertyReadTag extends PropertyTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@property} tag in a Docblock.
|
* Reflection class for a {@property} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class PropertyTag extends ParamTag
|
class PropertyTag extends ParamTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@property} tag in a Docblock.
|
* Reflection class for a {@property} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class PropertyWriteTag extends PropertyTag
|
class PropertyWriteTag extends PropertyTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@return} tag in a Docblock.
|
* Reflection class for a {@return} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ReturnTag extends ParamTag
|
class ReturnTag extends ParamTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -16,9 +16,9 @@ use phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@see} tag in a Docblock.
|
* Reflection class for a {@see} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class SeeTag extends Tag
|
class SeeTag extends Tag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -17,9 +17,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
*
|
*
|
||||||
* This is a very common error, so @throw is aliased to be @throws
|
* This is a very common error, so @throw is aliased to be @throws
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ThrowTag extends ThrowsTag
|
class ThrowTag extends ThrowsTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@throws} tag in a Docblock.
|
* Reflection class for a {@throws} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ThrowsTag extends ReturnTag
|
class ThrowsTag extends ReturnTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@uses} tag in a Docblock.
|
* Reflection class for a {@uses} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class UsesTag extends SeeTag
|
class UsesTag extends SeeTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor
|
* phpDocumentor
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Reflection class for a {@var} tag in a Docblock.
|
* Reflection class for a {@var} tag in a Docblock.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class VarTag extends ParamTag
|
class VarTag extends ParamTag
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* phpDocumentor
|
||||||
|
*
|
||||||
|
* PHP Version 5.3
|
||||||
|
*
|
||||||
|
* @author Mike van Riel <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Type;
|
namespace phpDocumentor\Reflection\DocBlock\Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Collection
|
||||||
|
*
|
||||||
|
* @author Mike van Riel <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
class Collection extends \ArrayObject
|
class Collection extends \ArrayObject
|
||||||
{
|
{
|
||||||
/** @var string Definition of the OR operator for types */
|
/** @var string Definition of the OR operator for types */
|
||||||
@@ -58,7 +77,7 @@ class Collection extends \ArrayObject
|
|||||||
}
|
}
|
||||||
$this->namespace_aliases = $namespace_aliases;
|
$this->namespace_aliases = $namespace_aliases;
|
||||||
|
|
||||||
foreach($types as $type) {
|
foreach ($types as $type) {
|
||||||
$this->add($type);
|
$this->add($type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +169,7 @@ class Collection extends \ArrayObject
|
|||||||
|
|
||||||
// separate the type by the OR operator
|
// separate the type by the OR operator
|
||||||
$type_parts = explode(self::OPERATOR_OR, $type);
|
$type_parts = explode(self::OPERATOR_OR, $type);
|
||||||
foreach($type_parts as $part) {
|
foreach ($type_parts as $part) {
|
||||||
$expanded_type = $this->expand($part);
|
$expanded_type = $this->expand($part);
|
||||||
if ($expanded_type) {
|
if ($expanded_type) {
|
||||||
$this[] = $expanded_type;
|
$this[] = $expanded_type;
|
||||||
@@ -168,12 +187,12 @@ class Collection extends \ArrayObject
|
|||||||
* This method only works as expected if the namespace and aliases are set;
|
* This method only works as expected if the namespace and aliases are set;
|
||||||
* no dynamic reflection is being performed here.
|
* no dynamic reflection is being performed here.
|
||||||
*
|
*
|
||||||
|
* @param string $type The relative or absolute type.
|
||||||
|
*
|
||||||
* @uses getNamespace to determine with what to prefix the type name.
|
* @uses getNamespace to determine with what to prefix the type name.
|
||||||
* @uses getNamespaceAliases to check whether the first part of the relative
|
* @uses getNamespaceAliases to check whether the first part of the relative
|
||||||
* type name should not be replaced with another namespace.
|
* type name should not be replaced with another namespace.
|
||||||
*
|
*
|
||||||
* @param string $type The relative or absolute type.
|
|
||||||
*
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function expand($type)
|
protected function expand($type)
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Covers Tag Test
|
* phpDocumentor Covers Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Covers
|
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Covers
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class CoversTagTest extends \PHPUnit_Framework_TestCase
|
class CoversTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -33,8 +39,7 @@ class CoversTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConstructorParesInputsIntoCorrectFields(
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$tag = new CoversTag($type, $content);
|
$tag = new CoversTag($type, $content);
|
||||||
|
|
||||||
$actualName = $tag->getName();
|
$actualName = $tag->getName();
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Link Tag Test
|
* phpDocumentor Link Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Ben Selby <[email protected]>
|
* @author Ben Selby <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
|
* Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
|
||||||
*
|
*
|
||||||
* @author Ben Selby <[email protected]>
|
* @author Ben Selby <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class LinkTagTest extends \PHPUnit_Framework_TestCase
|
class LinkTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -34,8 +40,7 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConstructorParesInputsIntoCorrectFields(
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
$type, $content, $exName, $exContent, $exDescription, $exLink
|
$type, $content, $exName, $exContent, $exDescription, $exLink
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$tag = new LinkTag($type, $content);
|
$tag = new LinkTag($type, $content);
|
||||||
|
|
||||||
$actualName = $tag->getName();
|
$actualName = $tag->getName();
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Method Tag Test
|
* phpDocumentor Method Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,14 +15,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
|
* Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class MethodTagTest extends \PHPUnit_Framework_TestCase
|
class MethodTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider getTestSignatures
|
|
||||||
*
|
|
||||||
* @param string $signature The signature to test
|
* @param string $signature The signature to test
|
||||||
* @param bool $valid Whether the given signature is expected to
|
* @param bool $valid Whether the given signature is expected to
|
||||||
* be valid.
|
* be valid.
|
||||||
@@ -29,12 +33,14 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
* @param bool $has_params whether this signature features parameters.
|
* @param bool $has_params whether this signature features parameters.
|
||||||
* @param string $description The short description mentioned in the
|
* @param string $description The short description mentioned in the
|
||||||
* signature.
|
* signature.
|
||||||
|
*
|
||||||
|
* @dataProvider getTestSignatures
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstruct($signature, $valid, $expected_name,
|
public function testConstruct($signature, $valid, $expected_name,
|
||||||
$expected_return, $has_params, $description)
|
$expected_return, $has_params, $description
|
||||||
{
|
) {
|
||||||
ob_start();
|
ob_start();
|
||||||
$tag = new MethodTag('method', $signature);
|
$tag = new MethodTag('method', $signature);
|
||||||
$stdout = ob_get_clean();
|
$stdout = ob_get_clean();
|
||||||
@@ -44,7 +50,9 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'No error should have been output if the signature is valid'
|
'No error should have been output if the signature is valid'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$valid) return;
|
if (!$valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->assertEquals($expected_name, $tag->getMethodName());
|
$this->assertEquals($expected_name, $tag->getMethodName());
|
||||||
$this->assertEquals($expected_return, $tag->getType());
|
$this->assertEquals($expected_return, $tag->getType());
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Param tag test.
|
* phpDocumentor Param tag test.
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_Param.
|
* Test class for phpDocumentor_Reflection_DocBlock_Param.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ParamTagTest extends \PHPUnit_Framework_TestCase
|
class ParamTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Return tag test.
|
* phpDocumentor Return tag test.
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_ReturnTag.
|
* Test class for phpDocumentor_Reflection_DocBlock_ReturnTag.
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class ReturnTagTest extends ParamTagTest
|
class ReturnTagTest extends ParamTagTest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor See Tag Test
|
* phpDocumentor See Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_Tag_See
|
* Test class for phpDocumentor_Reflection_DocBlock_Tag_See
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class SeeTagTest extends \PHPUnit_Framework_TestCase
|
class SeeTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -33,8 +39,7 @@ class SeeTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConstructorParesInputsIntoCorrectFields(
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$tag = new SeeTag($type, $content);
|
$tag = new SeeTag($type, $content);
|
||||||
|
|
||||||
$actualName = $tag->getName();
|
$actualName = $tag->getName();
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Uses Tag Test
|
* phpDocumentor Uses Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Uses
|
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Uses
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class UsesTagTest extends \PHPUnit_Framework_TestCase
|
class UsesTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -33,8 +39,7 @@ class UsesTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConstructorParesInputsIntoCorrectFields(
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$tag = new UsesTag($type, $content);
|
$tag = new UsesTag($type, $content);
|
||||||
|
|
||||||
$actualName = $tag->getName();
|
$actualName = $tag->getName();
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* phpDocumentor Var Tag Test
|
* phpDocumentor Var Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
@@ -11,8 +15,10 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Link
|
* Test class for phpDocumentor_Reflection_DocBlock_Tag_Link
|
||||||
*
|
*
|
||||||
* @author Daniel O'Connor <[email protected]>
|
* @author Daniel O'Connor <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class VarTagTest extends \PHPUnit_Framework_TestCase
|
class VarTagTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -33,8 +39,7 @@ class VarTagTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConstructorParesInputsIntoCorrectFields(
|
public function testConstructorParesInputsIntoCorrectFields(
|
||||||
$type, $content, $exType, $exVariable, $exDescription
|
$type, $content, $exType, $exVariable, $exDescription
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$tag = new VarTag($type, $content);
|
$tag = new VarTag($type, $content);
|
||||||
|
|
||||||
$this->assertEquals($exType, $tag->getType());
|
$this->assertEquals($exType, $tag->getType());
|
||||||
|
|||||||
@@ -1,9 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* phpDocumentor Covers Tag Test
|
||||||
|
*
|
||||||
|
* PHP version 5.3
|
||||||
|
*
|
||||||
|
* @author Mike van Riel <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection\DocBlock\Type;
|
namespace phpDocumentor\Reflection\DocBlock\Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock
|
* Test class for phpDocumentor_Reflection_DocBlock
|
||||||
|
*
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection
|
||||||
|
*
|
||||||
|
* @author Mike van Riel <[email protected]>
|
||||||
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class CollectionTest extends \PHPUnit_Framework_TestCase
|
class CollectionTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@@ -11,6 +28,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
@@ -22,6 +41,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithTypes()
|
public function testConstructWithTypes()
|
||||||
{
|
{
|
||||||
@@ -32,6 +53,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithNamespace()
|
public function testConstructWithNamespace()
|
||||||
{
|
{
|
||||||
@@ -48,6 +71,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testConstructWithNamespaceAliases()
|
public function testConstructWithNamespaceAliases()
|
||||||
{
|
{
|
||||||
@@ -59,6 +84,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespace
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespace
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testSetAndGetNamespace()
|
public function testSetAndGetNamespace()
|
||||||
{
|
{
|
||||||
@@ -78,6 +105,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespaceAliases
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespaceAliases
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testSetAndGetNamespaceAliases()
|
public function testSetAndGetNamespaceAliases()
|
||||||
{
|
{
|
||||||
@@ -94,6 +123,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
*
|
*
|
||||||
* @dataProvider provideTypesToExpand
|
* @dataProvider provideTypesToExpand
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAdd($fixture, $expected)
|
public function testAdd($fixture, $expected)
|
||||||
{
|
{
|
||||||
@@ -111,6 +142,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
*
|
*
|
||||||
* @dataProvider provideTypesToExpandWithoutNamespace
|
* @dataProvider provideTypesToExpandWithoutNamespace
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAddWithoutNamespace($fixture, $expected)
|
public function testAddWithoutNamespace($fixture, $expected)
|
||||||
{
|
{
|
||||||
@@ -124,6 +157,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
/**
|
/**
|
||||||
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
* @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
|
||||||
* @expectedException InvalidArgumentException
|
* @expectedException InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testAddWithInvalidArgument()
|
public function testAddWithInvalidArgument()
|
||||||
{
|
{
|
||||||
@@ -135,7 +170,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
* Returns the types and their expected values to test the retrieval of
|
* Returns the types and their expected values to test the retrieval of
|
||||||
* types.
|
* types.
|
||||||
*
|
*
|
||||||
* @param string $method Name of the method consuming this data provider.
|
* @param string $method Name of the method consuming this data provider.
|
||||||
* @param string $namespace Name of the namespace to user as basis.
|
* @param string $namespace Name of the namespace to user as basis.
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
@@ -181,7 +216,6 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
|||||||
* types when no namespace is available.
|
* types when no namespace is available.
|
||||||
*
|
*
|
||||||
* @param string $method Name of the method consuming this data provider.
|
* @param string $method Name of the method consuming this data provider.
|
||||||
* @param string $namespace Name of the namespace to user as basis.
|
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
/**
|
/**
|
||||||
* phpDocumentor DocBlock Test
|
* phpDocumentor DocBlock Test
|
||||||
*
|
*
|
||||||
* PHP Version 5
|
* PHP Version 5.3
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpDocumentor\Reflection;
|
namespace phpDocumentor\Reflection;
|
||||||
@@ -13,8 +15,10 @@ namespace phpDocumentor\Reflection;
|
|||||||
/**
|
/**
|
||||||
* Test class for phpDocumentor_Reflection_DocBlock
|
* Test class for phpDocumentor_Reflection_DocBlock
|
||||||
*
|
*
|
||||||
* @author Mike van Riel <[email protected]>
|
* @author Mike van Riel <[email protected]>
|
||||||
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
*/
|
*/
|
||||||
class DocBlockTest extends \PHPUnit_Framework_TestCase
|
class DocBlockTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user