Added getters for Serializer options;

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.
This commit is contained in:
Vasil Rangelov
2013-05-27 01:27:07 +03:00
parent 8b529636bf
commit b7797b4e1a
3 changed files with 163 additions and 61 deletions
+21 -7
View File
@@ -229,24 +229,38 @@ class DocBlock implements \Reflector
$this->tags = $result;
}
public function getText(){
/**
* Gets the text portion of the doc block.
*
* Gets the text portion (short and long description combined) of the doc
* block.
*
* @return string The text portion of the doc block.
*/
public function getText()
{
$short = $this->getShortDescription();
$long = $this->getLongDescription()->getContents();
if($long){
if ($long) {
return $short . "\n\n" . $long;
}else{
} else {
return $short;
}
}
/**
* Set the short and long description.
* Set the text portion of the doc block.
*
* Sets the text portion (short and long description combined) of the doc
* block.
*
* @param string $docblock
* @return $this
* @param string $docblock The new text portion of the doc block.
*
* @return $this This doc block.
*/
public function setText($comment){
public function setText($comment)
{
list($short, $long) = $this->splitDocBlock($comment);
$this->short_description = $short;
$this->long_description = new DocBlock\Description($long, $this);