@@ -3,6 +3,7 @@ class Method
33 {
44 public $ line ; // number, line number in the source file this is found on?
55 public $ name ; // bringToTop, kill, etc
6+ public $ title = [];
67 public $ parameters = []; // an array containing the parameters
78 public $ help = [];
89 public $ returns = false ;
@@ -11,27 +12,6 @@ class Method
1112 public $ isProtected = false ;
1213 public $ isPrivate = false ;
1314
14- public function getArray ()
15- {
16- $ a = array (
17- 'name ' => $ this ->name ,
18- 'returns ' => $ this ->returns ,
19- 'help ' => implode ('\n ' , $ this ->help ),
20- 'line ' => $ this ->line ,
21- 'public ' => $ this ->isPublic ,
22- 'protected ' => $ this ->isProtected ,
23- 'private ' => $ this ->isPrivate ,
24- );
25-
26- return $ a ;
27-
28- }
29-
30- public function getJSON ()
31- {
32- return json_encode ($ this ->getArray ());
33- }
34-
3515 public function __construct ($ block )
3616 {
3717 // Because zero offset + allowing for final line
@@ -66,6 +46,8 @@ public function __construct($block)
6646 $ this ->isPrivate = true ;
6747 }
6848
49+ $ this ->title = array ("name " => $ this ->name , "visibility " => $ this ->getVisibility ());
50+
6951 $ this ->help = $ block ->cleanContent ();
7052
7153 if ($ block ->getTypeBoolean ('@return ' ))
@@ -75,5 +57,42 @@ public function __construct($block)
7557
7658 }
7759
60+ public function getVisibility ()
61+ {
62+ if ($ this ->isPublic )
63+ {
64+ return 'public ' ;
65+ }
66+ else if ($ this ->isProtected )
67+ {
68+ return 'protected ' ;
69+ }
70+ else if ($ this ->isPrivate )
71+ {
72+ return 'private ' ;
73+ }
74+ }
75+
76+ public function getArray ()
77+ {
78+ $ a = array (
79+ 'title ' => $ this ->title ,
80+ 'returns ' => $ this ->returns ,
81+ 'help ' => implode ('\n ' , $ this ->help ),
82+ 'line ' => $ this ->line ,
83+ 'public ' => $ this ->isPublic ,
84+ 'protected ' => $ this ->isProtected ,
85+ 'private ' => $ this ->isPrivate ,
86+ );
87+
88+ return $ a ;
89+
90+ }
91+
92+ public function getJSON ()
93+ {
94+ return json_encode ($ this ->getArray ());
95+ }
96+
7897 }
7998?>
0 commit comments