196
196
namespace ast ;
197
197
198
198
/**
199
+ * Parses code file and returns AST root node.
200
+ *
199
201
* @param string $filename Code file to parse
200
- * @param int $version API version
202
+ * @param int $version AST version
201
203
* @return Node Root node of AST
204
+ *
202
205
* @see https://github.com/nikic/php-ast for version information
203
206
*/
204
207
function parse_file ($ filename , $ version )
@@ -207,10 +210,12 @@ function parse_file($filename, $version)
207
210
208
211
/**
209
212
* Parses code string and returns AST root node.
210
- * @param string $code Code string to parse
211
- * @param int $version API version
212
- * @param string $filename Optional - specifies filename of parsed file
213
+ *
214
+ * @param string $code Code string to parse
215
+ * @param int $version AST version
216
+ * @param string $filename Optional filename for use in parse errors
213
217
* @return Node Root node of AST
218
+ *
214
219
* @see https://github.com/nikic/php-ast for version information
215
220
*/
216
221
function parse_code ($ code , $ version , $ filename = "string code " )
@@ -219,23 +224,22 @@ function parse_code($code, $version, $filename = "string code")
219
224
220
225
/**
221
226
* @param int $kind AST_* constant value defining the kind of an AST node
222
- * @return string string representation of AST kind value
227
+ * @return string String representation of AST kind value
223
228
*/
224
229
function get_kind_name ($ kind )
225
230
{
226
231
}
227
232
228
233
/**
229
234
* @param int $kind AST_* constant value defining the kind of an AST node
230
- * @return bool returns true if AST kind uses flags
235
+ * @return bool Returns true if AST kind uses flags
231
236
*/
232
237
function kind_uses_flags ($ kind )
233
238
{
234
239
}
235
240
236
241
/**
237
242
* This class describes a single node in a PHP AST.
238
- * @package ast
239
243
*/
240
244
class Node
241
245
{
@@ -249,28 +253,26 @@ class Node
249
253
*/
250
254
public $ flags ;
251
255
252
- /** @var int source line number */
256
+ /** @var int Line the node starts in */
253
257
public $ lineno ;
254
258
255
- /** @var array Child nodes, if any exist */
259
+ /** @var array Child nodes (may be empty) */
256
260
public $ children ;
257
261
}
258
262
259
263
namespace ast \Node ;
260
264
261
265
/**
262
266
* AST Node type for function and class declarations.
263
- * Class Decl
264
- * @package ast\Node
265
267
*/
266
268
class Decl extends \ast \Node
267
269
{
268
- /** @var int end line number of the declaration */
270
+ /** @var int End line number of the declaration */
269
271
public $ endLineno ;
270
272
271
- /** @var string name of the function or class */
273
+ /** @var string Name of the function or class (not including the namespace prefix) */
272
274
public $ name ;
273
275
274
- /** @var string|null doc comment preceeding the declaration. null if no doc comment was used. */
276
+ /** @var string|null Doc comment preceeding the declaration. null if no doc comment was used. */
275
277
public $ docComment ;
276
278
}
0 commit comments