Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node.php
1 <?php declare(strict_types=1);
2
3 namespace PhpParser;
4
5 interface Node
6 {
7     /**
8      * Gets the type of the node.
9      *
10      * @return string Type of the node
11      */
12     public function getType() : string;
13
14     /**
15      * Gets the names of the sub nodes.
16      *
17      * @return array Names of sub nodes
18      */
19     public function getSubNodeNames() : array;
20
21     /**
22      * Gets line the node started in (alias of getStartLine).
23      *
24      * @return int Start line (or -1 if not available)
25      */
26     public function getLine() : int;
27
28     /**
29      * Gets line the node started in.
30      *
31      * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
32      *
33      * @return int Start line (or -1 if not available)
34      */
35     public function getStartLine() : int;
36
37     /**
38      * Gets the line the node ended in.
39      *
40      * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
41      *
42      * @return int End line (or -1 if not available)
43      */
44     public function getEndLine() : int;
45
46     /**
47      * Gets the token offset of the first token that is part of this node.
48      *
49      * The offset is an index into the array returned by Lexer::getTokens().
50      *
51      * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
52      *
53      * @return int Token start position (or -1 if not available)
54      */
55     public function getStartTokenPos() : int;
56
57     /**
58      * Gets the token offset of the last token that is part of this node.
59      *
60      * The offset is an index into the array returned by Lexer::getTokens().
61      *
62      * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
63      *
64      * @return int Token end position (or -1 if not available)
65      */
66     public function getEndTokenPos() : int;
67
68     /**
69      * Gets the file offset of the first character that is part of this node.
70      *
71      * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
72      *
73      * @return int File start position (or -1 if not available)
74      */
75     public function getStartFilePos() : int;
76
77     /**
78      * Gets the file offset of the last character that is part of this node.
79      *
80      * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
81      *
82      * @return int File end position (or -1 if not available)
83      */
84     public function getEndFilePos() : int;
85
86     /**
87      * Gets all comments directly preceding this node.
88      *
89      * The comments are also available through the "comments" attribute.
90      *
91      * @return Comment[]
92      */
93     public function getComments() : array;
94
95     /**
96      * Gets the doc comment of the node.
97      *
98      * The doc comment has to be the last comment associated with the node.
99      *
100      * @return null|Comment\Doc Doc comment object or null
101      */
102     public function getDocComment();
103
104     /**
105      * Sets the doc comment of the node.
106      *
107      * This will either replace an existing doc comment or add it to the comments array.
108      *
109      * @param Comment\Doc $docComment Doc comment to set
110      */
111     public function setDocComment(Comment\Doc $docComment);
112
113     /**
114      * Sets an attribute on a node.
115      *
116      * @param string $key
117      * @param mixed  $value
118      */
119     public function setAttribute(string $key, $value);
120
121     /**
122      * Returns whether an attribute exists.
123      *
124      * @param string $key
125      *
126      * @return bool
127      */
128     public function hasAttribute(string $key) : bool;
129
130     /**
131      * Returns the value of an attribute.
132      *
133      * @param string $key
134      * @param mixed  $default
135      *
136      * @return mixed
137      */
138     public function getAttribute(string $key, $default = null);
139
140     /**
141      * Returns all the attributes of this node.
142      *
143      * @return array
144      */
145     public function getAttributes() : array;
146
147     /**
148      * Replaces all the attributes of this node.
149      *
150      * @param array $attributes
151      */
152     public function setAttributes(array $attributes);
153 }