@@ -21,7 +21,7 @@ class ApiEnabled_Notification extends MIDAS_Notification
21
21
* This function is for getting the webapi methods defined in the API
22
22
* component of the implementing class. To enable this add the following
23
23
* line to your init function.
24
- *
24
+ *
25
25
* $this->enableWebAPI();
26
26
*
27
27
*/
@@ -30,34 +30,34 @@ public function getWebApiMethods()
30
30
$ methods = array ();
31
31
$ r = new ReflectionClass ($ this ->ModuleComponent ->Api );
32
32
$ meths = $ r ->getMethods (ReflectionMethod::IS_PUBLIC );
33
- foreach ( $ meths as $ m )
33
+ foreach ($ meths as $ m )
34
34
{
35
- if (strpos ($ m ->getDeclaringClass ()->getName (),'ApiComponent ' ))
35
+ if (strpos ($ m ->getDeclaringClass ()->getName (), 'ApiComponent ' ))
36
36
{
37
37
$ realName = $ m ->getName ();
38
38
$ docString = $ m ->getDocComment ();
39
- $ docString = trim ($ docString ,'/ ' );
40
- $ docAttributes = explode ('@ ' ,$ docString );
39
+ $ docString = trim ($ docString , '/ ' );
40
+ $ docAttributes = explode ('@ ' , $ docString );
41
41
$ return = '' ;
42
42
$ description = '' ;
43
43
$ params = array ();
44
44
$ example = array ();
45
- foreach ( $ docAttributes as $ docEntry )
45
+ foreach ($ docAttributes as $ docEntry )
46
46
{
47
- $ explodedDoc = explode ('* ' ,$ docEntry );
47
+ $ explodedDoc = explode ('* ' , $ docEntry );
48
48
array_walk ($ explodedDoc ,
49
49
create_function ('&$val ' , '$val = trim($val); ' ));
50
- $ doc = implode ('' ,$ explodedDoc );
51
- if (strpos ($ doc ,'param ' ) === 0 )
50
+ $ doc = implode ('' , $ explodedDoc );
51
+ if (strpos ($ doc , 'param ' ) === 0 )
52
52
{
53
- $ splitParam = explode (' ' ,$ doc );
53
+ $ splitParam = explode (' ' , $ doc );
54
54
$ paramName = trim ($ splitParam [1 ]);
55
- $ paramValue = trim (implode (' ' ,array_slice ($ splitParam ,2 )));
55
+ $ paramValue = trim (implode (' ' , array_slice ($ splitParam , 2 )));
56
56
$ params [$ paramName ] = $ paramValue ;
57
57
}
58
- elseif (strpos ($ doc ,'return ' ) === 0 )
58
+ elseif (strpos ($ doc , 'return ' ) === 0 )
59
59
{
60
- $ return = trim (substr ($ doc ,6 ));
60
+ $ return = trim (substr ($ doc , 6 ));
61
61
}
62
62
else
63
63
{
@@ -70,7 +70,7 @@ public function getWebApiMethods()
70
70
$ help ['example ' ] = $ example ;
71
71
$ help ['return ' ] = $ return ;
72
72
$ help ['description ' ] = $ description ;
73
- $ methods [] = array ('name ' => $ name ,
73
+ $ methods [] = array ('name ' => $ name ,
74
74
'help ' => $ help ,
75
75
'callbackObject ' => &$ this ->ModuleComponent ->Api ,
76
76
'callbackFunction ' => $ realName );
0 commit comments