diff --git a/src/phpDocumentor/Reflection/DocBlock.php b/src/phpDocumentor/Reflection/DocBlock.php index 60fda141..e82ceba2 100644 --- a/src/phpDocumentor/Reflection/DocBlock.php +++ b/src/phpDocumentor/Reflection/DocBlock.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,9 +15,9 @@ /** * Parses the DocBlock for any structure. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class DocBlock implements \Reflector { @@ -25,14 +25,14 @@ class DocBlock implements \Reflector protected $short_description = ''; /** - * @var \phpDocumentor\Reflection\DocBlock\LongDescription The actual description - * for this docblock. + * @var \phpDocumentor\Reflection\DocBlock\LongDescription The actual + * description for this docblock. */ protected $long_description = null; /** - * @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all the tags - * in this docblock; except inline. + * @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all + * the tags in this docblock; except inline. */ protected $tags = array(); @@ -52,19 +52,21 @@ class DocBlock implements \Reflector * For example the param and return tags use this to expand their type * information. * - * @param \Reflector|string $docblock A docblock comment (including asterisks) - * or reflector supporting the getDocComment method. - * @param string $namespace The namespace where this DocBlock resides in; - * defaults to `\`. - * @param string[] $namespace_aliases a list of namespace aliases 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. + * @param \Reflector|string $docblock A docblock comment (including + * asterisks) or reflector supporting the getDocComment method. + * @param string $namespace The namespace where this + * DocBlock resides in; defaults to `\`. + * @param string[] $namespace_aliases A list of namespace aliases + * 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. * * @throws \InvalidArgumentException if the given argument does not have the * getDocComment method. */ public function __construct( - $docblock, $namespace = '\\', $namespace_aliases = array() + $docblock, + $namespace = '\\', + $namespace_aliases = array() ) { if (is_object($docblock)) { if (!method_exists($docblock, 'getDocComment')) { @@ -99,7 +101,9 @@ protected function cleanInput($comment) { $comment = trim( preg_replace( - '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment + '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', + '$1', + $comment ) ); @@ -121,7 +125,7 @@ protected function cleanInput($comment) * @param string $comment Comment to split into the sub-parts. * * @author RichardJ Special thanks to RichardJ for the regex responsible - * for the split/ + * for the split. * * @return string[] containing the short-, long description and an element * containing the tags. @@ -173,7 +177,9 @@ protected function splitDocBlock($comment) ) )? (\s+ [\s\S]*)? # everything that follows - /u', $comment, $matches + /u', + $comment, + $matches ); array_shift($matches); } @@ -306,9 +312,10 @@ public function hasTag($name) * @param string $type Type to expand into full namespaced * equivalent. * @param string[] $ignore_keywords Whether to ignore given keywords, when - * null it will use the default keywords: 'string', 'int', 'integer', - * 'bool', 'boolean', 'float', 'double', 'object', 'mixed', 'array', - * 'resource', 'void', 'null', 'callback', 'false', 'true'. + * null it will use the default keywords: + * 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', + * 'object', 'mixed', 'array', 'resource', 'void', 'null', 'callback', + * 'false', 'true', 'self', '$this', 'callable'. * Default value for this parameter is null. * * @return string @@ -321,9 +328,9 @@ public function expandType($type, $ignore_keywords = null) if ($ignore_keywords === null) { $ignore_keywords = array( - 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', - 'object', 'mixed', 'array', 'resource', 'void', 'null', - 'callback', 'false', 'true', 'self', '$this', 'callable' + 'string', 'int', 'integer', 'bool', 'boolean', 'float', + 'double', 'object', 'mixed', 'array', 'resource', 'void', + 'null', 'callback', 'false', 'true', 'self', '$this', 'callable' ); } @@ -382,7 +389,7 @@ public function expandType($type, $ignore_keywords = null) * * @return string */ - static public function export() + public static function export() { throw new \Exception('Not yet implemented'); } diff --git a/src/phpDocumentor/Reflection/DocBlock/LongDescription.php b/src/phpDocumentor/Reflection/DocBlock/LongDescription.php index 7fb8fa70..857ac663 100644 --- a/src/phpDocumentor/Reflection/DocBlock/LongDescription.php +++ b/src/phpDocumentor/Reflection/DocBlock/LongDescription.php @@ -15,9 +15,9 @@ /** * Parses a Long Description of a DocBlock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class LongDescription implements \Reflector { @@ -51,18 +51,20 @@ public function getContents() return $this->contents; } - /* + /** * Returns the parsed text of this description. * * @return array An array of strings and tag objects, in the order they - * occur within the description. + * occur within the description. */ public function getParsedContents() { if (null === $this->parsedContents) { $this->parsedContents = preg_split( - '/\{(\@.*?)\}/uS', $this->contents, - null, PREG_SPLIT_DELIM_CAPTURE + '/\{(\@.*?)\}/uS', + $this->contents, + null, + PREG_SPLIT_DELIM_CAPTURE ); for ($i=1, $l = count($this->parsedContents); $i<$l; $i += 2) { $this->parsedContents[$i] = Tag::createInstance( @@ -97,8 +99,8 @@ public function getFormattedContents() } if (class_exists('dflydev\markdown\MarkdownExtraParser')) { - $md = new \dflydev\markdown\MarkdownExtraParser(); - $result = $md->transformMarkdown($result); + $markdown = new \dflydev\markdown\MarkdownExtraParser(); + $result = $markdown->transformMarkdown($result); } return trim($result); @@ -107,11 +109,12 @@ public function getFormattedContents() /** * Builds a string representation of this object. * - * @todo determine the exact format as used by PHP Reflection and implement it. + * @todo determine the exact format as used by PHP Reflection + * and implement it. * * @return void */ - static public function export() + public static function export() { throw new \Exception('Not yet implemented'); } @@ -126,4 +129,4 @@ public function __toString() { return 'Not yet implemented'; } -} \ No newline at end of file +} diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag.php b/src/phpDocumentor/Reflection/DocBlock/Tag.php index 4ad36202..ffd30279 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,9 +15,9 @@ /** * Parses a tag definition for a DocBlock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class Tag implements \Reflector { @@ -29,7 +29,7 @@ class Tag implements \Reflector /** @var string Description of the content of this tag */ protected $description = ''; - + /** @var array The description, as an array of strings and Tag objects. */ protected $parsedDescription = null; @@ -51,7 +51,9 @@ class Tag implements \Reflector public static function createInstance($tag_line) { if (!preg_match( - '/^@([\w\-\_\\\\]+)(?:\s*([^\s].*)|$)?/us', $tag_line, $matches + '/^@([\w\-\_\\\\]+)(?:\s*([^\s].*)|$)?/us', + $tag_line, + $matches )) { throw new \InvalidArgumentException( 'Invalid tag_line detected: ' . $tag_line @@ -60,7 +62,9 @@ public static function createInstance($tag_line) // support hypphen separated tag names $tag_name = str_replace( - ' ', '', ucwords(str_replace('-', ' ', $matches[1])) + ' ', + '', + ucwords(str_replace('-', ' ', $matches[1])) ).'Tag'; $class_name = 'phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name; @@ -111,12 +115,12 @@ public function getDescription() { return $this->description; } - - /* + + /** * Returns the parsed text of this description. * * @return array An array of strings and tag objects, in the order they - * occur within the description. + * occur within the description. */ public function getParsedDescription() { @@ -170,7 +174,7 @@ public function setDocBlock($docblock) * * @return void */ - static public function export() + public static function export() { throw new \Exception('Not yet implemented'); } @@ -185,5 +189,4 @@ public function __toString() { return 'Not yet implemented'; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php index 3eeda2f0..d714240f 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php @@ -2,9 +2,9 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * - * @author Mike van Riel + * @author Vasil Rangelov * @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 @@ -17,18 +17,18 @@ /** * Reflection class for an @author tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class AuthorTag extends Tag { /** @var string The name of the author */ protected $name = ''; - + /** @var string The email of the author */ protected $email = ''; - + /** * Parses a tag and populates the member variables. * @@ -45,7 +45,7 @@ public function __construct($type, $content) } } } - + /** * Gets the author's name. * @@ -55,7 +55,7 @@ public function getAuthorName() { return $this->name; } - + /** * Gets the author's email. * diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php index 49ae236b..bd31b56b 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a @covers tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class CoversTag extends SeeTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php index 3e89c739..7c798a96 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Ben Selby * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -11,14 +11,15 @@ */ namespace phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor\Reflection\DocBlock\Tag; /** * Reflection class for a @link tag in a Docblock. * - * @author Ben Selby - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Ben Selby + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class LinkTag extends Tag { diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php index 1c407b01..3d45ec2a 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,9 +15,9 @@ /** * Reflection class for a {@method} in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class MethodTag extends ParamTag { @@ -49,8 +49,8 @@ public function __construct($type, $content) // until a ) and whitespace : as method name with signature // 5. any remaining text : as description if (preg_match( - '/^[\s]*(?:([\w\|_\\\\]+)[\s]+)?(?:[\w_]+\(\)[\s]+)?([\w\|_\\\\]+)\(([^\)]*)\)' - .'[\s]*(.*)/u', + '/^[\s]*(?:([\w\|_\\\\]+)[\s]+)?(?:[\w_]+\(\)[\s]+)?([\w\|_\\\\]+)' + .'\(([^\)]*)\)[\s]*(.*)/u', $content, $matches )) { @@ -61,8 +61,7 @@ public function __construct($type, $content) $this->arguments, $this->description ) = $matches; - if (!$this->type) - { + if (!$this->type) { $this->type = 'void'; } } else { @@ -126,5 +125,4 @@ public function getArguments() return $arguments; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php index 21255660..e222b9bd 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -11,14 +11,15 @@ */ namespace phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor\Reflection\DocBlock\Tag; /** * Reflection class for a {@param} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class ParamTag extends Tag { @@ -43,12 +44,18 @@ public function __construct($type, $content) $content = preg_split('/\s+/u', $content); // 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); } // 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); } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php index e27c5d38..61d2fda1 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a {@property} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class PropertyReadTag extends PropertyTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php index a19180a8..b9ddaea9 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a {@property} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class PropertyTag extends ParamTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php index 8fbde97d..d6a38be5 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a {@property} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class PropertyWriteTag extends PropertyTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php index 3c7725f7..f893309a 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,9 +15,9 @@ /** * Reflection class for a {@return} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class ReturnTag extends ParamTag { @@ -42,5 +42,4 @@ public function __construct($type, $content) $this->description = implode(' ', $content); } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php index 57878f7a..7dd67977 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -11,14 +11,15 @@ */ namespace phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor\Reflection\DocBlock\Tag; /** * Reflection class for a {@see} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class SeeTag extends Tag { @@ -52,5 +53,4 @@ public function getReference() { return $this->refers; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php index fda4e6d5..e893ce55 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -17,9 +17,9 @@ * * This is a very common error, so @throw is aliased to be @throws * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class ThrowTag extends ThrowsTag { @@ -40,4 +40,4 @@ public function __construct($type, $content) parent::__construct('throws', $content); } -} \ No newline at end of file +} diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php index 91132143..4066f10c 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a {@throws} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class ThrowsTag extends ReturnTag { - -} \ No newline at end of file +} diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php index 679bb028..05e8d0b6 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,11 +15,10 @@ /** * Reflection class for a {@uses} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class UsesTag extends SeeTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php index 854e0489..a9a8f618 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php @@ -2,7 +2,7 @@ /** * phpDocumentor * - * PHP Version 5 + * PHP Version 5.3 * * @author Mike van Riel * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) @@ -15,9 +15,9 @@ /** * Reflection class for a {@var} tag in a Docblock. * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org + * @author Mike van Riel + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org */ class VarTag extends ParamTag { diff --git a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php index e72c051d..e48df852 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php +++ b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php @@ -1,6 +1,25 @@ + * @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; +/** + * Collection + * + * @author Mike van Riel + * @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 { /** @var string Definition of the OR operator for types */ @@ -49,7 +68,8 @@ class Collection extends \ArrayObject * pairs that are used in the resolving process. */ public function __construct( - array $types = array(), $namespace = null, + array $types = array(), + $namespace = null, array $namespace_aliases = array() ) { // only set the namespace if overridden @@ -58,7 +78,7 @@ public function __construct( } $this->namespace_aliases = $namespace_aliases; - foreach($types as $type) { + foreach ($types as $type) { $this->add($type); } } @@ -150,7 +170,7 @@ public function add($type) // separate the type by the OR operator $type_parts = explode(self::OPERATOR_OR, $type); - foreach($type_parts as $part) { + foreach ($type_parts as $part) { $expanded_type = $this->expand($part); if ($expanded_type) { $this[] = $expanded_type; @@ -168,12 +188,12 @@ public function add($type) * This method only works as expected if the namespace and aliases are set; * 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 getNamespaceAliases to check whether the first part of the relative * type name should not be replaced with another namespace. * - * @param string $type The relative or absolute type. - * * @return string */ protected function expand($type) @@ -245,4 +265,4 @@ protected function isRelativeType($type) return ($type[0] !== self::OPERATOR_NAMESPACE) || $this->isTypeAKeyword($type); } -} \ No newline at end of file +} diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php index dfcd3534..2cb20337 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php @@ -1,24 +1,30 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_Tag_Covers + * Test class for \phpDocumentor\Reflection\DocBlock\Tag\CoversTag * - * @author Daniel O'Connor - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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 { /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\Covers can create a link - * for the covers doc block + * Test that the \phpDocumentor\Reflection\DocBlock\Tag\CoversTag can create + * a link for the covers doc block. * * @param string $type * @param string $content @@ -32,9 +38,13 @@ class CoversTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParesInputsIntoCorrectFields( - $type, $content, $exName, $exContent, $exDescription, $exReference - ) - { + $type, + $content, + $exName, + $exContent, + $exDescription, + $exReference + ) { $tag = new CoversTag($type, $content); $actualName = $tag->getName(); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php index 99de8211..7eebc5ca 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php @@ -1,9 +1,13 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Ben Selby + * @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; @@ -11,8 +15,10 @@ /** * Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag * - * @author Ben Selby - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Ben Selby + * @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 { @@ -33,9 +39,13 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParesInputsIntoCorrectFields( - $type, $content, $exName, $exContent, $exDescription, $exLink - ) - { + $type, + $content, + $exName, + $exContent, + $exDescription, + $exLink + ) { $tag = new LinkTag($type, $content); $actualName = $tag->getName(); @@ -84,4 +94,4 @@ public function provideDataForConstuctor() ), ); } -} \ No newline at end of file +} diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php index c6ffdba7..08d5957c 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php @@ -1,9 +1,13 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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; @@ -11,14 +15,14 @@ /** * Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag * - * @author Mike van Riel - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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 { /** - * @dataProvider getTestSignatures - * * @param string $signature The signature to test * @param bool $valid Whether the given signature is expected to * be valid. @@ -29,28 +33,39 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase * @param bool $has_params whether this signature features parameters. * @param string $description The short description mentioned in the * signature. + * + * @dataProvider getTestSignatures * * @return void */ - public function testConstruct($signature, $valid, $expected_name, - $expected_return, $has_params, $description) - { + public function testConstruct( + $signature, + $valid, + $expected_name, + $expected_return, + $has_params, + $description + ) { ob_start(); $tag = new MethodTag('method', $signature); $stdout = ob_get_clean(); $this->assertSame( - $valid, empty($stdout), + $valid, + empty($stdout), '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($description, $tag->getDescription()); + $this->assertEquals($description, $tag->getDescription()); $this->assertSame( - $has_params, (bool)(count($tag->getArguments()) > 0), + $has_params, + (bool)(count($tag->getArguments()) > 0), 'Number of found arguments should exceed 0' ); } @@ -112,4 +127,4 @@ public function getTestSignatures() ), ); } -} \ No newline at end of file +} diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php index fd5448af..f24a7716 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php @@ -1,18 +1,24 @@ - * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_Param. + * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag. * - * @author Mike van Riel - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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 { @@ -22,9 +28,9 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase * * @param string $type * @param string $content - * @param string $extracted_type - * @param string $extracted_variable_name - * @param string $extracted_description + * @param string $extractedType + * @param string $extractedVarName + * @param string $extractedDescription * * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag::__construct * @@ -33,14 +39,17 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParsesInputsIntoCorrectFields( - $type, $content, $extracted_type, $extracted_variable_name, - $extracted_description + $type, + $content, + $extractedType, + $extractedVarName, + $extractedDescription ) { $tag = new ParamTag($type, $content); - $this->assertEquals($extracted_type, $tag->getTypes()); - $this->assertEquals($extracted_variable_name, $tag->getVariableName()); - $this->assertEquals($extracted_description, $tag->getDescription()); + $this->assertEquals($extractedType, $tag->getTypes()); + $this->assertEquals($extractedVarName, $tag->getVariableName()); + $this->assertEquals($extractedDescription, $tag->getDescription()); } /** diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php index 48515790..74512e65 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php @@ -1,18 +1,24 @@ - * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_ReturnTag. + * Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag. * - * @author Mike van Riel - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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 { @@ -21,8 +27,8 @@ class ReturnTagTest extends ParamTagTest * understand the Return DocBlock. * * @param string $content - * @param string $extracted_type - * @param string $extracted_description + * @param string $extractedType + * @param string $extractedDescription * * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag::__construct * @@ -31,12 +37,14 @@ class ReturnTagTest extends ParamTagTest * @return void */ public function testConstructorParsesInputsIntoCorrectFields( - $content, $extracted_type, $extracted_description + $content, + $extractedType, + $extractedDescription ) { $tag = new ReturnTag('return', $content); - $this->assertEquals($extracted_type, $tag->getTypes()); - $this->assertEquals($extracted_description, $tag->getDescription()); + $this->assertEquals($extractedType, $tag->getTypes()); + $this->assertEquals($extractedDescription, $tag->getDescription()); } /** diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php index a1e9747c..2f270ed8 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php @@ -1,18 +1,24 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_Tag_See + * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SeeTag * - * @author Daniel O'Connor - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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 { @@ -32,9 +38,13 @@ class SeeTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParesInputsIntoCorrectFields( - $type, $content, $exName, $exContent, $exDescription, $exReference - ) - { + $type, + $content, + $exName, + $exContent, + $exDescription, + $exReference + ) { $tag = new SeeTag($type, $content); $actualName = $tag->getName(); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php index 115b86e8..513f4d5a 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php @@ -1,18 +1,24 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_Tag_Uses + * Test class for \phpDocumentor\Reflection\DocBlock\Tag\UsesTag * - * @author Daniel O'Connor - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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 { @@ -32,9 +38,13 @@ class UsesTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParesInputsIntoCorrectFields( - $type, $content, $exName, $exContent, $exDescription, $exReference - ) - { + $type, + $content, + $exName, + $exContent, + $exDescription, + $exReference + ) { $tag = new UsesTag($type, $content); $actualName = $tag->getName(); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php index de4b2d20..b759fa6f 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php @@ -1,24 +1,30 @@ - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock_Tag_Link + * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag * - * @author Daniel O'Connor - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Daniel O'Connor + * @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 { /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can understand - * the @var doc block + * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can + * understand the @var doc block * * @param string $type * @param string $content @@ -32,14 +38,17 @@ class VarTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParesInputsIntoCorrectFields( - $type, $content, $exType, $exVariable, $exDescription - ) - { + $type, + $content, + $exType, + $exVariable, + $exDescription + ) { $tag = new VarTag($type, $content); $this->assertEquals($exType, $tag->getType()); - $this->assertEquals($exVariable, $tag->getVariableName()); - $this->assertEquals($exDescription, $tag->getDescription()); + $this->assertEquals($exVariable, $tag->getVariableName()); + $this->assertEquals($exDescription, $tag->getDescription()); } /** diff --git a/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php index 70c98ea1..2c13337f 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php @@ -1,9 +1,26 @@ + * @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; /** - * Test class for phpDocumentor_Reflection_DocBlock + * Test class for \phpDocumentor\Reflection\DocBlock\Type\Collection + * * @covers phpDocumentor\Reflection\DocBlock\Type\Collection + * + * @author Mike van Riel + * @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 { @@ -11,6 +28,8 @@ class CollectionTest extends \PHPUnit_Framework_TestCase * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases + * + * @return void */ public function testConstruct() { @@ -22,6 +41,8 @@ public function testConstruct() /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct + * + * @return void */ public function testConstructWithTypes() { @@ -32,6 +53,8 @@ public function testConstructWithTypes() /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace + * + * @return void */ public function testConstructWithNamespace() { @@ -48,6 +71,8 @@ public function testConstructWithNamespace() /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases + * + * @return void */ public function testConstructWithNamespaceAliases() { @@ -59,6 +84,8 @@ public function testConstructWithNamespaceAliases() /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespace * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespace + * + * @return void */ public function testSetAndGetNamespace() { @@ -78,6 +105,8 @@ public function testSetAndGetNamespace() /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::setNamespaceAliases * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getNamespaceAliases + * + * @return void */ public function testSetAndGetNamespaceAliases() { @@ -94,6 +123,8 @@ public function testSetAndGetNamespaceAliases() * * @dataProvider provideTypesToExpand * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add + * + * @return void */ public function testAdd($fixture, $expected) { @@ -111,6 +142,8 @@ public function testAdd($fixture, $expected) * * @dataProvider provideTypesToExpandWithoutNamespace * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add + * + * @return void */ public function testAddWithoutNamespace($fixture, $expected) { @@ -124,6 +157,8 @@ public function testAddWithoutNamespace($fixture, $expected) /** * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add * @expectedException InvalidArgumentException + * + * @return void */ public function testAddWithInvalidArgument() { @@ -135,7 +170,7 @@ public function testAddWithInvalidArgument() * Returns the types and their expected values to test the retrieval of * 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. * * @return string[] @@ -181,7 +216,6 @@ public function provideTypesToExpand($method, $namespace = '\My\Space\\') * types when no namespace is available. * * @param string $method Name of the method consuming this data provider. - * @param string $namespace Name of the namespace to user as basis. * * @return string[] */ @@ -189,6 +223,4 @@ public function provideTypesToExpandWithoutNamespace($method) { return $this->provideTypesToExpand($method, '\\'); } - } - diff --git a/tests/phpDocumentor/Reflection/DocBlockTest.php b/tests/phpDocumentor/Reflection/DocBlockTest.php index 328a2c74..30797588 100644 --- a/tests/phpDocumentor/Reflection/DocBlockTest.php +++ b/tests/phpDocumentor/Reflection/DocBlockTest.php @@ -2,10 +2,12 @@ /** * phpDocumentor DocBlock Test * - * PHP Version 5 + * PHP Version 5.3 * - * @author Mike van Riel - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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; @@ -13,8 +15,10 @@ /** * Test class for phpDocumentor_Reflection_DocBlock * - * @author Mike van Riel - * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) + * @author Mike van Riel + * @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 { @@ -32,7 +36,8 @@ public function testConstruct() DOCBLOCK; $object = new DocBlock($fixture); $this->assertEquals( - 'This is a short description.', $object->getShortDescription() + 'This is a short description.', + $object->getShortDescription() ); $this->assertEquals( 'This is a long description.', @@ -53,11 +58,13 @@ public function testDotSeperation() DOCBLOCK; $object = new DocBlock($fixture); $this->assertEquals( - 'This is a short description.', $object->getShortDescription() + 'This is a short description.', + $object->getShortDescription() ); $this->assertEquals( "This is a long description.\nThis is a continuation of the long " - ."description.", $object->getLongDescription()->getContents() + ."description.", + $object->getLongDescription()->getContents() ); } @@ -99,17 +106,21 @@ public function testExpandTypeWithoutNamespace() public function testExpandTypeUsingNamespaceAlias() { $docblock = new DocBlock( - '', '\My\Namespace', array('Alias' => '\My\Namespace\Alias') + '', + '\My\Namespace', + array('Alias' => '\My\Namespace\Alias') ); // first try a normal resolution without alias $this->assertEquals( - '\My\Namespace\Al', $docblock->expandType('Al') + '\My\Namespace\Al', + $docblock->expandType('Al') ); // try to use the alias $this->assertEquals( - '\My\Namespace\Alias\Al', $docblock->expandType('Alias\Al') + '\My\Namespace\Alias\Al', + $docblock->expandType('Alias\Al') ); } @@ -141,4 +152,3 @@ public function getNonExpandableKeywordsForExpandType() ); } } -