Tons of coding standard fixes.

This commit is contained in:
Vasil Rangelov
2012-11-04 15:16:37 +02:00
parent 6b707f7166
commit 009237bad2
28 changed files with 251 additions and 144 deletions
+14 -14
View File
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection;
/**
* Parses the DocBlock for any structure.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class DocBlock implements \Reflector
{
@@ -31,8 +31,8 @@ class DocBlock implements \Reflector
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,16 +52,16 @@ 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.
* getDocComment method.
*/
public function __construct(
$docblock, $namespace = '\\', $namespace_aliases = array()
@@ -15,9 +15,9 @@ namespace phpDocumentor\Reflection\DocBlock;
/**
* Parses a Long Description of a DocBlock.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class LongDescription implements \Reflector
{
@@ -51,7 +51,7 @@ class LongDescription implements \Reflector
return $this->contents;
}
/*
/**
* Returns the parsed text of this description.
*
* @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')) {
$md = new \dflydev\markdown\MarkdownExtraParser();
$result = $md->transformMarkdown($result);
$markdown = new \dflydev\markdown\MarkdownExtraParser();
$result = $markdown->transformMarkdown($result);
}
return trim($result);
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class Tag implements \Reflector
{
@@ -112,7 +112,7 @@ class Tag implements \Reflector
return $this->description;
}
/*
/**
* Returns the parsed text of this description.
*
* @return array An array of strings and tag objects, in the order they
@@ -2,9 +2,9 @@
/**
* 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)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
@@ -17,9 +17,9 @@ use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for an @author tag in a Docblock.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class AuthorTag extends Tag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class CoversTag extends SeeTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Ben Selby <[email protected]>
* @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.
*
* @author Ben Selby <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Ben Selby <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class LinkTag extends Tag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class MethodTag extends ParamTag
{
@@ -49,8 +49,8 @@ class MethodTag extends ParamTag
// 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 @@ class MethodTag extends ParamTag
$this->arguments,
$this->description
) = $matches;
if (!$this->type)
{
if (!$this->type) {
$this->type = 'void';
}
} else {
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class ParamTag extends Tag
{
@@ -43,12 +43,18 @@ class ParamTag extends Tag
$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);
}
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class PropertyReadTag extends PropertyTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class PropertyTag extends ParamTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class PropertyWriteTag extends PropertyTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class ReturnTag extends ParamTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class SeeTag extends Tag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class ThrowTag extends ThrowsTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class ThrowsTag extends ReturnTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class UsesTag extends SeeTag
{
@@ -2,7 +2,7 @@
/**
* phpDocumentor
*
* PHP Version 5
* PHP Version 5.3
*
* @author Mike van Riel <[email protected]>
* @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.
*
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
* @author Mike van Riel <[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
class VarTag extends ParamTag
{
@@ -1,6 +1,25 @@
<?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;
/**
* 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
{
/** @var string Definition of the OR operator for types */
@@ -58,7 +77,7 @@ class Collection extends \ArrayObject
}
$this->namespace_aliases = $namespace_aliases;
foreach($types as $type) {
foreach ($types as $type) {
$this->add($type);
}
}
@@ -150,7 +169,7 @@ class Collection extends \ArrayObject
// 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 +187,12 @@ class Collection extends \ArrayObject
* 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)