Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/BasicClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ various PHPDoc tags are used.

| Name | Description |
|------|-------------|
|[__construct](#basicclass__construct)|Constructs an object|
|[__construct](#basicclass__construct)|Constructs an object of some specific type with certain unspoken defaults.|
|[addValues](#basicclassaddvalues)|Adds two arguments|
|[one](#basicclassone)|Returns one|

Expand All @@ -29,14 +29,15 @@ various PHPDoc tags are used.
public __construct (array $options)
```

Constructs an object
Constructs an object of some specific type with certain unspoken defaults.



**Parameters**

* `(array) $options`
: options
: the user's desired settings for the object being
created.

**Return Values**

Expand Down
6 changes: 4 additions & 2 deletions example/BasicClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ class BasicClass
public $config;

/**
* Constructs an object
* Constructs an object of some specific type with certain unspoken
* defaults.
*
* @param array $options options
* @param array $options the user's desired settings for the object being
* created.
*
* @return void
*/
Expand Down
16 changes: 15 additions & 1 deletion src/Markdown/ClassInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ abstract public function getFormatName();
public function render()
{
$parser = new ClassParser($this->reflectionClass);
$methods = $parser->getMethodsDetails();
$methods = [];
foreach ($parser->getMethodsDetails() as $methodName => $methodDetails) {
$methodDetails->shortDescription = $this
->removeHardLineBreaks($methodDetails->shortDescription);
$methods[$methodName] = $methodDetails;
}
ksort($methods);

$this->setData(
Expand All @@ -45,4 +50,13 @@ public function render()
);
return parent::render();
}

/** Strip hard line wraps from string */
private function removeHardLineBreaks($text) {
return preg_replace(
['(\n)', '( +)'],
[' ', ' '],
$text
);
}
}