Made PSR2 related fixes that are compatible with the PEAR coding standard.

This commit is contained in:
Vasil Rangelov
2012-11-04 16:02:57 +02:00
parent 9ea3275389
commit bb189b87bd
27 changed files with 107 additions and 61 deletions
+10 -4
View File
@@ -64,7 +64,9 @@ class DocBlock implements \Reflector
* 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 @@ class DocBlock implements \Reflector
{
$comment = trim(
preg_replace(
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u',
'$1',
$comment
)
);
@@ -173,7 +177,9 @@ class DocBlock implements \Reflector
)
)?
(\s+ [\s\S]*)? # everything that follows
/u', $comment, $matches
/u',
$comment,
$matches
);
array_shift($matches);
}
@@ -382,7 +388,7 @@ class DocBlock implements \Reflector
*
* @return string
*/
static public function export()
public static function export()
{
throw new \Exception('Not yet implemented');
}
@@ -61,8 +61,10 @@ class LongDescription implements \Reflector
{
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(
@@ -111,7 +113,7 @@ class LongDescription implements \Reflector
*
* @return void
*/
static public function export()
public static function export()
{
throw new \Exception('Not yet implemented');
}
@@ -126,4 +128,4 @@ class LongDescription implements \Reflector
{
return 'Not yet implemented';
}
}
}
@@ -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 @@ class Tag implements \Reflector
// 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,7 +115,7 @@ class Tag implements \Reflector
{
return $this->description;
}
/**
* Returns the parsed text of this description.
*
@@ -170,7 +174,7 @@ class Tag implements \Reflector
*
* @return void
*/
static public function export()
public static function export()
{
throw new \Exception('Not yet implemented');
}
@@ -185,5 +189,4 @@ class Tag implements \Reflector
{
return 'Not yet implemented';
}
}
@@ -25,10 +25,10 @@ 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 @@ class AuthorTag extends Tag
}
}
}
/**
* Gets the author's name.
*
@@ -55,7 +55,7 @@ class AuthorTag extends Tag
{
return $this->name;
}
/**
* Gets the author's email.
*
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class CoversTag extends SeeTag
{
}
@@ -11,6 +11,7 @@
*/
namespace phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
@@ -125,5 +125,4 @@ class MethodTag extends ParamTag
return $arguments;
}
}
@@ -11,6 +11,7 @@
*/
namespace phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class PropertyReadTag extends PropertyTag
{
}
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class PropertyTag extends ParamTag
{
}
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class PropertyWriteTag extends PropertyTag
{
}
@@ -42,5 +42,4 @@ class ReturnTag extends ParamTag
$this->description = implode(' ', $content);
}
}
@@ -11,6 +11,7 @@
*/
namespace phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
@@ -52,5 +53,4 @@ class SeeTag extends Tag
{
return $this->refers;
}
}
@@ -40,4 +40,4 @@ class ThrowTag extends ThrowsTag
parent::__construct('throws', $content);
}
}
}
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class ThrowsTag extends ReturnTag
{
}
}
@@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag;
*/
class UsesTag extends SeeTag
{
}
@@ -68,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
@@ -264,4 +265,4 @@ class Collection extends \ArrayObject
return ($type[0] !== self::OPERATOR_NAMESPACE)
|| $this->isTypeAKeyword($type);
}
}
}