Skip to content

Commit a68c79f

Browse files
committed
initial import
1 parent 428cd04 commit a68c79f

File tree

10 files changed

+832
-0
lines changed

10 files changed

+832
-0
lines changed

Readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PHP Doc generator (BETA)
2+
3+
A class and cli script to generate a markdown doc page from a class file.
4+
5+
You can customize the output or create output in another wanted format.
6+
7+
Compatible to PHP 8.3
8+
9+
👤 Author: Axel Hahn
10+
📄 Source: <https://github.com/axelhahn/php-classdoc>
11+
📜 License: GNU GPL 3.0
12+
📗 Docs: TODO

config/md/index.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Class {{name}}
2+
3+
{{comment}}
4+
5+
## Properties
6+
7+
{{properties.tpl}}
8+
9+
## Methods
10+
11+
{{methods.tpl}}
12+
13+
---
14+
Generated with Axels PHP class doc parser.

config/md/methods.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### {{type}}{{name}}
2+
3+
{{comment}}
4+
5+
**Parameters**: **{{parameters_count}}** (required: {{parameters_required}})
6+
7+
{{parameters.tpl}}
8+
9+
**Return**: {{returntype}}
10+

config/md/parameter.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{string}} | {{type}} | {{phpdoc_descr}}

config/md/parameters.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| Parameter | Type | Description
2+
|-- |-- |--
3+
{{parameter.tpl}}

config/md/properties.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### {{type}}${{name}}
2+
3+
{{comment}}
4+
5+
type: {{vartype}}
6+
7+
default value: {{defaultvalue}}
8+

docs/70_Class.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
## Class axelhahn\phpclassparser
2+
3+
4+
PHP CLASS PARSER
5+
@author axelhahn
6+
@license GNU GPL 3.0
7+
8+
@source <https://github.com/axelhahn/TODO>
9+
10+
11+
12+
## Properties
13+
14+
(none)
15+
16+
## Methods
17+
18+
### public __construct
19+
20+
21+
Constructs a new instance of the class.
22+
23+
24+
25+
**Parameters**: **1** (required: 0)
26+
27+
| Parameter | Type | Description
28+
|-- |-- |--
29+
\<optional\> string $sClassname = '' | string | optional: The name of the class. Default is an empty string.
30+
31+
32+
33+
**Return**:
34+
35+
### public getClassInfos
36+
37+
38+
39+
**Parameters**: **0** (required: 0)
40+
41+
42+
43+
**Return**: array
44+
45+
### public getMethods
46+
47+
48+
Get a hash of methods with its type, parameters, phpdoc infos
49+
50+
51+
**Parameters**: **1** (required: 0)
52+
53+
| Parameter | Type | Description
54+
|-- |-- |--
55+
\<optional\> $bPublicOnly = true | string * | flag: public only methods or all; default: true (=only public methods)
56+
57+
58+
59+
**Return**: array
60+
61+
### public getProperties
62+
63+
64+
Get a hash of properties with its type, phpdoc infos, default value, attributes, etc.
65+
66+
67+
68+
**Parameters**: **1** (required: 0)
69+
70+
| Parameter | Type | Description
71+
|-- |-- |--
72+
\<optional\> $bPublicOnly = true | bool * | flag: public only properties or all; default: true (=only public properties)
73+
74+
75+
76+
**Return**: array
77+
78+
### public setClassFile
79+
80+
81+
Sets the class file to be analyzed.
82+
It will detect namespace and class name to initialize the class.
83+
84+
85+
86+
**Parameters**: **1** (required: 1)
87+
88+
| Parameter | Type | Description
89+
|-- |-- |--
90+
\<required\> string $file | string | The path to the class file.
91+
92+
93+
94+
**Return**: string|bool
95+
96+
### public setClassname
97+
98+
99+
Set a classname.
100+
You can use that method directly if the class file was loaded before.
101+
Or use setClassFile() to load the class file and detect the classname.
102+
@see setClassFile()
103+
104+
105+
**Parameters**: **1** (required: 1)
106+
107+
| Parameter | Type | Description
108+
|-- |-- |--
109+
\<required\> string $sClassname | string | classname to access for doc generation
110+
111+
112+
113+
**Return**: void
114+
115+
116+
117+
---
118+
Generated with Axels PHP class doc parser.

0 commit comments

Comments
 (0)