Skip to content

Commit e7c507c

Browse files
committed
Tweak stubs file
1 parent 8dc57ab commit e7c507c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

ast_stub.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,12 @@
196196
namespace ast;
197197

198198
/**
199+
* Parses code file and returns AST root node.
200+
*
199201
* @param string $filename Code file to parse
200-
* @param int $version API version
202+
* @param int $version AST version
201203
* @return Node Root node of AST
204+
*
202205
* @see https://github.com/nikic/php-ast for version information
203206
*/
204207
function parse_file($filename, $version)
@@ -207,10 +210,12 @@ function parse_file($filename, $version)
207210

208211
/**
209212
* 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
213217
* @return Node Root node of AST
218+
*
214219
* @see https://github.com/nikic/php-ast for version information
215220
*/
216221
function parse_code($code, $version, $filename = "string code")
@@ -219,23 +224,22 @@ function parse_code($code, $version, $filename = "string code")
219224

220225
/**
221226
* @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
223228
*/
224229
function get_kind_name($kind)
225230
{
226231
}
227232

228233
/**
229234
* @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
231236
*/
232237
function kind_uses_flags($kind)
233238
{
234239
}
235240

236241
/**
237242
* This class describes a single node in a PHP AST.
238-
* @package ast
239243
*/
240244
class Node
241245
{
@@ -249,28 +253,26 @@ class Node
249253
*/
250254
public $flags;
251255

252-
/** @var int source line number */
256+
/** @var int Line the node starts in */
253257
public $lineno;
254258

255-
/** @var array Child nodes, if any exist */
259+
/** @var array Child nodes (may be empty) */
256260
public $children;
257261
}
258262

259263
namespace ast\Node;
260264

261265
/**
262266
* AST Node type for function and class declarations.
263-
* Class Decl
264-
* @package ast\Node
265267
*/
266268
class Decl extends \ast\Node
267269
{
268-
/** @var int end line number of the declaration */
270+
/** @var int End line number of the declaration */
269271
public $endLineno;
270272

271-
/** @var string name of the function or class */
273+
/** @var string Name of the function or class (not including the namespace prefix) */
272274
public $name;
273275

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. */
275277
public $docComment;
276278
}

0 commit comments

Comments
 (0)