diff --git a/src/phpDocumentor/Reflection/DocBlock.php b/src/phpDocumentor/Reflection/DocBlock.php index 0f4b5ea..383eaca 100644 --- a/src/phpDocumentor/Reflection/DocBlock.php +++ b/src/phpDocumentor/Reflection/DocBlock.php @@ -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'); } diff --git a/src/phpDocumentor/Reflection/DocBlock/LongDescription.php b/src/phpDocumentor/Reflection/DocBlock/LongDescription.php index 9ede73c..76d5f9f 100644 --- a/src/phpDocumentor/Reflection/DocBlock/LongDescription.php +++ b/src/phpDocumentor/Reflection/DocBlock/LongDescription.php @@ -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'; } -} \ No newline at end of file +} diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag.php b/src/phpDocumentor/Reflection/DocBlock/Tag.php index 89fc9e2..ba02db3 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag.php @@ -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'; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php index ff5aab0..d714240 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php @@ -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. * diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php index da136d9..bd31b56 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ class CoversTag extends SeeTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php index 0893fed..7c798a9 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php @@ -11,6 +11,7 @@ */ namespace phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor\Reflection\DocBlock\Tag; /** diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php index 4c03243..3d45ec2 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php @@ -125,5 +125,4 @@ class MethodTag extends ParamTag return $arguments; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php index 71e16d1..e222b9b 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php @@ -11,6 +11,7 @@ */ namespace phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor\Reflection\DocBlock\Tag; /** diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php index 2675376..61d2fda 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ class PropertyReadTag extends PropertyTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php index 08ca1b7..b9ddaea 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ class PropertyTag extends ParamTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php index 22e9cb4..d6a38be 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ class PropertyWriteTag extends PropertyTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php index 63cea4f..f893309 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php @@ -42,5 +42,4 @@ class ReturnTag extends ParamTag $this->description = implode(' ', $content); } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php index 8e63d6c..7dd6797 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php @@ -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; } - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php index 59d7d1d..e893ce5 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowTag.php @@ -40,4 +40,4 @@ class ThrowTag extends ThrowsTag 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 e95b7cf..4066f10 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ 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 9c4e6b1..05e8d0b 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php +++ b/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php @@ -21,5 +21,4 @@ namespace phpDocumentor\Reflection\DocBlock\Tag; */ class UsesTag extends SeeTag { - } diff --git a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php index 0b21d41..e48df85 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php +++ b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php @@ -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); } -} \ 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 771dafc..51ebc0b 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php @@ -38,7 +38,12 @@ 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); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php index 49af279..7eebc5c 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php @@ -39,7 +39,12 @@ 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); @@ -89,4 +94,4 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase ), ); } -} \ 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 4901080..08d5957 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php @@ -38,15 +38,21 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase * * @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' ); @@ -54,11 +60,12 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase 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' ); } @@ -120,4 +127,4 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase ), ); } -} \ 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 5dd3441..9ee3086 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php @@ -39,14 +39,17 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase * @return void */ public function testConstructorParsesInputsIntoCorrectFields( - $type, $content, $extracted_type, $extracted_variable_name, + $type, + $content, + $extracted_type, + $extracted_variable_name, $extracted_description ) { $tag = new ParamTag($type, $content); - $this->assertEquals($extracted_type, $tag->getTypes()); + $this->assertEquals($extracted_type, $tag->getTypes()); $this->assertEquals($extracted_variable_name, $tag->getVariableName()); - $this->assertEquals($extracted_description, $tag->getDescription()); + $this->assertEquals($extracted_description, $tag->getDescription()); } /** diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php index 8c2b136..2f6e8e9 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php @@ -37,12 +37,14 @@ class ReturnTagTest extends ParamTagTest * @return void */ public function testConstructorParsesInputsIntoCorrectFields( - $content, $extracted_type, $extracted_description + $content, + $extracted_type, + $extracted_description ) { $tag = new ReturnTag('return', $content); - $this->assertEquals($extracted_type, $tag->getTypes()); - $this->assertEquals($extracted_description, $tag->getDescription()); + $this->assertEquals($extracted_type, $tag->getTypes()); + $this->assertEquals($extracted_description, $tag->getDescription()); } /** diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php index 781f45f..231a154 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php @@ -38,7 +38,12 @@ 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); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php index 84f0bd2..b9e3f16 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php @@ -38,7 +38,12 @@ 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); diff --git a/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php index 6ede97d..3565170 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php @@ -38,13 +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 7288458..23263a7 100644 --- a/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php @@ -223,6 +223,4 @@ class CollectionTest extends \PHPUnit_Framework_TestCase { return $this->provideTypesToExpand($method, '\\'); } - } - diff --git a/tests/phpDocumentor/Reflection/DocBlockTest.php b/tests/phpDocumentor/Reflection/DocBlockTest.php index c08447c..3079758 100644 --- a/tests/phpDocumentor/Reflection/DocBlockTest.php +++ b/tests/phpDocumentor/Reflection/DocBlockTest.php @@ -36,7 +36,8 @@ class DocBlockTest extends \PHPUnit_Framework_TestCase 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.', @@ -57,11 +58,13 @@ DOCBLOCK; 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() ); } @@ -103,17 +106,21 @@ DOCBLOCK; 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') ); } @@ -145,4 +152,3 @@ DOCBLOCK; ); } } -