When dealing with inline @see or @link tags and having a relative method or property type
like LinkDescriptor::setLink() and a namespace alias like phpDocumentor\Descriptor\Tag\LinkDescriptor
Collection::expand() was checking if LinkDescriptor::setLink() could be found in the namespace aliases.
This would never be true.
In this fix, the method or type (for instance ::setLink()) part is removed for comparison
and later re-added when generating the full name
DocBlocks may start with #@+ and #@- to indicate that they are (the start) of a DocBlock
template or the end of a template.
In this commit I have changed the way a DocBlock is parsed to interpret this information
and added tests to show for it. In addition I have added more comments to the Regular
Expression responsible for splitting a DocBlock to show the business rules more clearly.
This is the first step in implementing https://github.com/phpDocumentor/phpDocumentor2/issues/42.
This is especially important when using markdown.
Adding a blank line between text introduces a new paragraph.
Current implementation will result in all text staying in one paragraph
and also other elements like lists and code do not get recognized in
most cases.
Performance improvement in Serializer - wrap length is calculated once during the text portion only. Tags reuse the result. Also no "prefix" adding in tags - the name is simply added before wrapping.
Swapped the indent and indent string options at Serializer's constructor;
Renamed Serializer::setIndentFirstLine() to setIsFirstLineIndented() in accordance with the getter (PHPMD fix);
Line length is now ACTUALLY line length, i.e. it takes the indentation into account, and is applied to tags as well;
Fixed ReturnTag::setContent() to set "types" to NULL;
A lot of doc and CS fixes at Serializer.php.
Changed the list of keywords to be static (for the purpose of reducing memory consumption);
Updated composer.lock with the latest dependencies (PHPUnit in particular).
Simplified @see and @link parsing;
Added comments to the regexes of @method, @example and @source;
Added a test case for what 2812eac046 intended to fix.
Tag::__construct() trims the description (as is common for most tag handlers), while the original contents is still in the $content property;
Added the DocBlock argument to all tag handlers.
Removed Tag::setDocblock() in favor of an additional constructor argument that defaults to NULL;
Tag::createInstance() and Description's constructor now have a second argument, allowing the specification of an owning DocBlock;
Description::getParsedContents() assigns the Description's owning DocBlock object when creating tags.
Removed ThrowTag.php (unnecessary, given the map, which aliases "throw" to ThrowsTag.php);
Added tests for ThrowsTag, along with a few other minor test additions and fixes;
Split the "testTagHandlerRegistration" test into several new ones, with appropriate @covers annotations added;
Although not required for single liners, class names at the built in tag handlers map are indented on a separate line for readability.