File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ various PHPDoc tags are used.
1414
1515| Name | Description |
1616| ------| -------------|
17- | [ __ construct] ( #basicclass__construct ) | Constructs an object|
17+ | [ __ construct] ( #basicclass__construct ) | Constructs an object of some specific type with certain unspoken defaults. |
1818| [ addValues] ( #basicclassaddvalues ) | Adds two arguments|
1919| [ one] ( #basicclassone ) | Returns one|
2020
@@ -29,14 +29,15 @@ various PHPDoc tags are used.
2929public __construct (array $options)
3030```
3131
32- Constructs an object
32+ Constructs an object of some specific type with certain unspoken defaults.
3333
3434
3535
3636** Parameters**
3737
3838* ` (array) $options `
39- : options
39+ : the user's desired settings for the object being
40+ created.
4041
4142** Return Values**
4243
Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ class BasicClass
1717 public $ config ;
1818
1919 /**
20- * Constructs an object
20+ * Constructs an object of some specific type with certain unspoken
21+ * defaults.
2122 *
22- * @param array $options options
23+ * @param array $options the user's desired settings for the object being
24+ * created.
2325 *
2426 * @return void
2527 */
Original file line number Diff line number Diff line change @@ -29,7 +29,12 @@ abstract public function getFormatName();
2929 public function render ()
3030 {
3131 $ parser = new ClassParser ($ this ->reflectionClass );
32- $ methods = $ parser ->getMethodsDetails ();
32+ $ methods = [];
33+ foreach ($ parser ->getMethodsDetails () as $ methodName => $ methodDetails ) {
34+ $ methodDetails ->shortDescription = $ this
35+ ->removeHardLineBreaks ($ methodDetails ->shortDescription );
36+ $ methods [$ methodName ] = $ methodDetails ;
37+ }
3338 ksort ($ methods );
3439
3540 $ this ->setData (
@@ -45,4 +50,13 @@ public function render()
4550 );
4651 return parent ::render ();
4752 }
53+
54+ /** Strip hard line wraps from string */
55+ private function removeHardLineBreaks ($ text ) {
56+ return preg_replace (
57+ ['(\n) ' , '( +) ' ],
58+ [' ' , ' ' ],
59+ $ text
60+ );
61+ }
4862}
You can’t perform that action at this time.
0 commit comments