File tree 3 files changed +23
-6
lines changed
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.
14
14
15
15
| Name | Description |
16
16
| ------| -------------|
17
- | [ __ construct] ( #basicclass__construct ) | Constructs an object|
17
+ | [ __ construct] ( #basicclass__construct ) | Constructs an object of some specific type with certain unspoken defaults. |
18
18
| [ addValues] ( #basicclassaddvalues ) | Adds two arguments|
19
19
| [ one] ( #basicclassone ) | Returns one|
20
20
@@ -29,14 +29,15 @@ various PHPDoc tags are used.
29
29
public __construct (array $options)
30
30
```
31
31
32
- Constructs an object
32
+ Constructs an object of some specific type with certain unspoken defaults.
33
33
34
34
35
35
36
36
** Parameters**
37
37
38
38
* ` (array) $options `
39
- : options
39
+ : the user's desired settings for the object being
40
+ created.
40
41
41
42
** Return Values**
42
43
Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ class BasicClass
17
17
public $ config ;
18
18
19
19
/**
20
- * Constructs an object
20
+ * Constructs an object of some specific type with certain unspoken
21
+ * defaults.
21
22
*
22
- * @param array $options options
23
+ * @param array $options the user's desired settings for the object being
24
+ * created.
23
25
*
24
26
* @return void
25
27
*/
Original file line number Diff line number Diff line change @@ -29,7 +29,12 @@ abstract public function getFormatName();
29
29
public function render ()
30
30
{
31
31
$ 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
+ }
33
38
ksort ($ methods );
34
39
35
40
$ this ->setData (
@@ -45,4 +50,13 @@ public function render()
45
50
);
46
51
return parent ::render ();
47
52
}
53
+
54
+ /** Strip hard line wraps from string */
55
+ private function removeHardLineBreaks ($ text ) {
56
+ return preg_replace (
57
+ ['(\n) ' , '( +) ' ],
58
+ [' ' , ' ' ],
59
+ $ text
60
+ );
61
+ }
48
62
}
You can’t perform that action at this time.
0 commit comments