forked from nikic/php-ast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathast.stub.php
More file actions
73 lines (62 loc) · 2.09 KB
/
ast.stub.php
File metadata and controls
73 lines (62 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/** @generate-function-entries */
/**
* USE ast_stub.php INSTEAD IF YOU ARE LOOKING FOR DOCUMENTATION OR STUBS FOR YOUR IDE.
*
* This is a stub file meant only for use with https://github.com/php/php-src/blob/master/build/gen_stub.php
* to generate Reflection information (ReflectionParameter, ReflectionFunction, ReflectionMethod, etc.)
*/
namespace ast;
/**
* Parses code file and returns AST root node.
*
* @param string $filename Code file to parse
* @param int $version AST version
* @return Node Root node of AST
*
* @see https://github.com/nikic/php-ast for version information
*/
function parse_code(string $code, int $version, string $filename = 'string code'): \ast\Node {}
function parse_file(string $filename, int $version): \ast\Node {}
/**
* @param int $kind AST_* constant value defining the kind of an AST node
* @return string String representation of AST kind value
*/
function get_kind_name(int $kind): string {}
/**
* @param int $kind AST_* constant value defining the kind of an AST node
* @return bool Returns true if AST kind uses flags
*/
function kind_uses_flags(int $kind): bool {}
/**
* Provides metadata for the AST kinds.
*
* The returned array is a map from AST kind to a Metadata object.
*
* @return Metadata[] Metadata about AST kinds
*/
function get_metadata(): array {}
/**
* Returns currently supported AST versions.
*
* @param bool $exclude_deprecated Whether to exclude deprecated versions
* @return int[] Array of supported AST versions
*/
function get_supported_versions(bool $exclude_deprecated = false): array {}
/**
* This class describes a single node in a PHP AST.
*/
class Node
{
/**
* A constructor which accepts any types for the properties.
* For backwards compatibility reasons, all values are optional and can be any type, and properties default to null
*
* @param int|null $kind
* @param int|null $flags
* @param array|null $children
* @param int|null $lineno
*/
public function __construct(?int $kind = null, ?int $flags = null, ?array $children = null, ?int $lineno = null) {
}
}