1
1
<?php
2
2
3
- class phpListRestapiDoc {
4
-
3
+ class phpListRestapiDoc
4
+ {
5
5
private $ classes ;
6
6
7
- function __construct ()
7
+ public function __construct ()
8
8
{
9
9
}
10
10
11
- function addClass ( $ classname ){
12
-
11
+ public function addClass ($ classname)
12
+ {
13
13
$ this ->classes [] = "phpListRestapi \\$ classname " ;
14
-
15
14
}
16
15
17
- function output (){
18
-
16
+ public function output ()
17
+ {
19
18
$ this ->header ();
20
19
21
- foreach ( $ this ->classes as $ class ){
22
-
23
- $ reflect = new \ReflectionClass ( $ class );
20
+ foreach ($ this ->classes as $ class ) {
21
+ $ reflect = new \ReflectionClass ($ class );
24
22
$ methods = $ reflect ->getMethods ();
25
- foreach ( $ methods as $ method ){
26
-
23
+ foreach ($ methods as $ method ) {
27
24
echo '<section> ' ;
28
25
echo '<div class="page-header"> ' ;
29
- echo '<h2> ' . $ method ->name . '</h2> ' ;
26
+ echo '<h2> ' . $ method ->name . '</h2> ' ;
30
27
echo '</div> ' ;
31
28
echo '<div class="row"> ' ;
32
29
echo '<div class="span12"> ' ;
33
30
34
31
$ comment = $ method ->getDocComment ();
35
32
36
- $ comment = str_replace ( '/** ' , '' , $ comment );
37
- $ comment = str_replace ( '*/ ' , '' , $ comment );
38
- $ comment = str_replace ( '[* ' , '<span class="label label-warning"> ' , $ comment );
39
- $ comment = str_replace ( '[ ' , '<span class="label label-success"> ' , $ comment );
40
- $ comment = str_replace ( '] ' , '</span> ' , $ comment );
41
- $ comment = str_replace ( '{ ' , '<span class="badge"> ' , $ comment );
42
- $ comment = str_replace ( '} ' , '</span> ' , $ comment );
43
- $ comment = str_replace ( '* ' , '' , $ comment );
33
+ $ comment = str_replace ('/** ' , '' , $ comment );
34
+ $ comment = str_replace ('*/ ' , '' , $ comment );
35
+ $ comment = str_replace ('[* ' , '<span class="label label-warning"> ' , $ comment );
36
+ $ comment = str_replace ('[ ' , '<span class="label label-success"> ' , $ comment );
37
+ $ comment = str_replace ('] ' , '</span> ' , $ comment );
38
+ $ comment = str_replace ('{ ' , '<span class="badge"> ' , $ comment );
39
+ $ comment = str_replace ('} ' , '</span> ' , $ comment );
40
+ $ comment = str_replace ('* ' , '' , $ comment );
44
41
//$comment = str_replace( '<br><br>', '', $comment );
45
42
46
43
echo trim ($ comment );
@@ -50,18 +47,15 @@ function output(){
50
47
echo '<br/> ' ;
51
48
echo '<section> ' ;
52
49
}
53
-
54
50
}
55
51
56
52
$ this ->footer ();
57
53
58
54
exit ;
59
-
60
55
}
61
56
62
-
63
- function header (){
64
-
57
+ public function header ()
58
+ {
65
59
?>
66
60
67
61
<!DOCTYPE html>
@@ -80,7 +74,8 @@ function header(){
80
74
<div class="row">
81
75
<div class="span6">
82
76
<h1>API Plugin to phpList</h1>
83
- <p class="lead">Documentation generated <?php echo date ('Y-m-d H:i:s ' ); ?> </p>
77
+ <p class="lead">Documentation generated <?php echo date ('Y-m-d H:i:s ' );
78
+ ?> </p>
84
79
</div>
85
80
</div>
86
81
</header>
@@ -100,8 +95,8 @@ function header(){
100
95
101
96
}
102
97
103
- function footer (){
104
-
98
+ public function footer ()
99
+ {
105
100
?>
106
101
<footer id="footer">
107
102
<p class="pull-right"><a href="#">Back to top</a></p>
@@ -113,6 +108,4 @@ function footer(){
113
108
<?php
114
109
115
110
}
116
-
117
-
118
111
}
0 commit comments