Chris@0
|
1 Version 3.1.3-dev
|
Chris@0
|
2 -----------------
|
Chris@0
|
3
|
Chris@0
|
4 Nothing yet.
|
Chris@0
|
5
|
Chris@0
|
6 Version 3.1.2 (2017-11-04)
|
Chris@0
|
7 --------------------------
|
Chris@0
|
8
|
Chris@0
|
9 ### Fixed
|
Chris@0
|
10
|
Chris@0
|
11 * Comments on empty blocks are now preserved on a `Stmt\Nop` node. (#382)
|
Chris@0
|
12
|
Chris@0
|
13 ### Added
|
Chris@0
|
14
|
Chris@0
|
15 * Added `kind` attribute for `Stmt\Namespace_` node, which is one of `KIND_SEMICOLON` or
|
Chris@0
|
16 `KIND_BRACED`. (#417)
|
Chris@0
|
17 * Added `setDocComment()` method to namespace builder. (#437)
|
Chris@0
|
18
|
Chris@0
|
19 Version 3.1.1 (2017-09-02)
|
Chris@0
|
20 --------------------------
|
Chris@0
|
21
|
Chris@0
|
22 ### Fixed
|
Chris@0
|
23
|
Chris@0
|
24 * Fixed syntax error on comment after brace-style namespace declaration. (#412)
|
Chris@0
|
25 * Added support for TraitUse statements in trait builder. (#413)
|
Chris@0
|
26
|
Chris@0
|
27 Version 3.1.0 (2017-07-28)
|
Chris@0
|
28 --------------------------
|
Chris@0
|
29
|
Chris@0
|
30 ### Added
|
Chris@0
|
31
|
Chris@0
|
32 * [PHP 7.2] Added support for trailing comma in group use statements.
|
Chris@0
|
33 * [PHP 7.2] Added support for `object` type. This means `object` types will now be represented as a
|
Chris@0
|
34 builtin type (a simple `"object"` string), rather than a class `Name`.
|
Chris@0
|
35
|
Chris@0
|
36 ### Fixed
|
Chris@0
|
37
|
Chris@0
|
38 * Floating-point numbers are now printed correctly if the LC_NUMERIC locale uses a comma as decimal
|
Chris@0
|
39 separator.
|
Chris@0
|
40
|
Chris@0
|
41 ### Changed
|
Chris@0
|
42
|
Chris@0
|
43 * `Name::$parts` is no longer deprecated.
|
Chris@0
|
44
|
Chris@0
|
45 Version 3.0.6 (2017-06-28)
|
Chris@0
|
46 --------------------------
|
Chris@0
|
47
|
Chris@0
|
48 ### Fixed
|
Chris@0
|
49
|
Chris@0
|
50 * Fixed the spelling of `Class_::VISIBILITY_MODIFIER_MASK`. The previous spelling of
|
Chris@0
|
51 `Class_::VISIBILITY_MODIFER_MASK` is preserved for backwards compatibility.
|
Chris@0
|
52 * The pretty printing will now preserve comments inside array literals and function calls by
|
Chris@0
|
53 printing the array items / function arguments on separate lines. Array literals and functions that
|
Chris@0
|
54 do not contain comments are not affected.
|
Chris@0
|
55
|
Chris@0
|
56 ### Added
|
Chris@0
|
57
|
Chris@0
|
58 * Added `Builder\Param::makeVariadic()`.
|
Chris@0
|
59
|
Chris@0
|
60 ### Deprecated
|
Chris@0
|
61
|
Chris@0
|
62 * The `Node::setLine()` method has been deprecated.
|
Chris@0
|
63
|
Chris@0
|
64 Version 3.0.5 (2017-03-05)
|
Chris@0
|
65 --------------------------
|
Chris@0
|
66
|
Chris@0
|
67 ### Fixed
|
Chris@0
|
68
|
Chris@0
|
69 * Name resolution of `NullableType`s is now performed earlier, so that a fully resolved signature is
|
Chris@0
|
70 available when a function is entered. (#360)
|
Chris@0
|
71 * `Error` nodes are now considered empty, while previously they extended until the token where the
|
Chris@0
|
72 error occurred. This made some nodes larger than expected. (#359)
|
Chris@0
|
73 * Fixed notices being thrown during error recovery in some situations. (#362)
|
Chris@0
|
74
|
Chris@0
|
75 Version 3.0.4 (2017-02-10)
|
Chris@0
|
76 --------------------------
|
Chris@0
|
77
|
Chris@0
|
78 ### Fixed
|
Chris@0
|
79
|
Chris@0
|
80 * Fixed some extensibility issues in pretty printer (`pUseType()` is now public and `pPrec()` calls
|
Chris@0
|
81 into `p()`, instead of directly dispatching to the type-specific printing method).
|
Chris@0
|
82 * Fixed notice in `bin/php-parse` script.
|
Chris@0
|
83
|
Chris@0
|
84 ### Added
|
Chris@0
|
85
|
Chris@0
|
86 * Error recovery from missing semicolons is now supported in more cases.
|
Chris@0
|
87 * Error recovery from trailing commas in positions where PHP does not support them is now supported.
|
Chris@0
|
88
|
Chris@0
|
89 Version 3.0.3 (2017-02-03)
|
Chris@0
|
90 --------------------------
|
Chris@0
|
91
|
Chris@0
|
92 ### Fixed
|
Chris@0
|
93
|
Chris@0
|
94 * In `"$foo[0]"` the `0` is now parsed as an `LNumber` rather than `String`. (#325)
|
Chris@0
|
95 * Ensure integers and floats are always pretty printed preserving semantics, even if the particular
|
Chris@0
|
96 value can only be manually constructed.
|
Chris@0
|
97 * Throw a `LogicException` when trying to pretty-print an `Error` node. Previously this resulted in
|
Chris@0
|
98 an undefined method exception or fatal error.
|
Chris@0
|
99
|
Chris@0
|
100 ### Added
|
Chris@0
|
101
|
Chris@0
|
102 * [PHP 7.1] Added support for negative interpolated offsets: `"$foo[-1]"`
|
Chris@0
|
103 * Added `preserveOriginalNames` option to `NameResolver`. If this option is enabled, an
|
Chris@0
|
104 `originalName` attribute, containing the unresolved name, will be added to each resolved name.
|
Chris@0
|
105 * Added `php-parse --with-positions` option, which dumps nodes with position information.
|
Chris@0
|
106
|
Chris@0
|
107 ### Deprecated
|
Chris@0
|
108
|
Chris@0
|
109 * The XML serializer has been deprecated. In particular, the classes `Serializer\XML`,
|
Chris@0
|
110 `Unserializer\XML`, as well as the interfaces `Serializer` and `Unserializer` are deprecated.
|
Chris@0
|
111
|
Chris@0
|
112 Version 3.0.2 (2016-12-06)
|
Chris@0
|
113 --------------------------
|
Chris@0
|
114
|
Chris@0
|
115 ### Fixed
|
Chris@0
|
116
|
Chris@0
|
117 * Fixed name resolution of nullable types. (#324)
|
Chris@0
|
118 * Fixed pretty-printing of nullable types.
|
Chris@0
|
119
|
Chris@0
|
120 Version 3.0.1 (2016-12-01)
|
Chris@0
|
121 --------------------------
|
Chris@0
|
122
|
Chris@0
|
123 ### Fixed
|
Chris@0
|
124
|
Chris@0
|
125 * Fixed handling of nested `list()`s: If the nested list was unkeyed, it was directly included in
|
Chris@0
|
126 the list items. If it was keyed, it was wrapped in `ArrayItem`. Now nested `List_` nodes are
|
Chris@0
|
127 always wrapped in `ArrayItem`s. (#321)
|
Chris@0
|
128
|
Chris@0
|
129 Version 3.0.0 (2016-11-30)
|
Chris@0
|
130 --------------------------
|
Chris@0
|
131
|
Chris@0
|
132 ### Added
|
Chris@0
|
133
|
Chris@0
|
134 * Added support for dumping node positions in the NodeDumper through the `dumpPositions` option.
|
Chris@0
|
135 * Added error recovery support for `$`, `new`, `Foo::`.
|
Chris@0
|
136
|
Chris@0
|
137 Version 3.0.0-beta2 (2016-10-29)
|
Chris@0
|
138 --------------------------------
|
Chris@0
|
139
|
Chris@0
|
140 This release primarily improves our support for error recovery.
|
Chris@0
|
141
|
Chris@0
|
142 ### Added
|
Chris@0
|
143
|
Chris@0
|
144 * Added `Node::setDocComment()` method.
|
Chris@0
|
145 * Added `Error::getMessageWithColumnInfo()` method.
|
Chris@0
|
146 * Added support for recovery from lexer errors.
|
Chris@0
|
147 * Added support for recovering from "special" errors (i.e. non-syntax parse errors).
|
Chris@0
|
148 * Added precise location information for lexer errors.
|
Chris@0
|
149 * Added `ErrorHandler` interface, and `ErrorHandler\Throwing` and `ErrorHandler\Collecting` as
|
Chris@0
|
150 specific implementations. These provide a general mechanism for handling error recovery.
|
Chris@0
|
151 * Added optional `ErrorHandler` argument to `Parser::parse()`, `Lexer::startLexing()` and
|
Chris@0
|
152 `NameResolver::__construct()`.
|
Chris@0
|
153 * The `NameResolver` now adds a `namespacedName` attribute on name nodes that cannot be statically
|
Chris@0
|
154 resolved (unqualified unaliased function or constant names in namespaces).
|
Chris@0
|
155
|
Chris@0
|
156 ### Fixed
|
Chris@0
|
157
|
Chris@0
|
158 * Fixed attribute assignment for `GroupUse` prefix and variables in interpolated strings.
|
Chris@0
|
159
|
Chris@0
|
160 ### Changed
|
Chris@0
|
161
|
Chris@0
|
162 * The constants on `NameTraverserInterface` have been moved into the `NameTraverser` class.
|
Chris@0
|
163 * Due to the error handling changes, the `Parser` interface and `Lexer` API have changed.
|
Chris@0
|
164 * The emulative lexer now directly postprocesses tokens, instead of using `~__EMU__~` sequences.
|
Chris@0
|
165 This changes the protected API of the lexer.
|
Chris@0
|
166 * The `Name::slice()` method now returns `null` for empty slices, previously `new Name([])` was
|
Chris@0
|
167 used. `Name::concat()` now also supports concatenation with `null`.
|
Chris@0
|
168
|
Chris@0
|
169 ### Removed
|
Chris@0
|
170
|
Chris@0
|
171 * Removed `Name::append()` and `Name::prepend()`. These mutable methods have been superseded by
|
Chris@0
|
172 the immutable `Name::concat()`.
|
Chris@0
|
173 * Removed `Error::getRawLine()` and `Error::setRawLine()`. These methods have been superseded by
|
Chris@0
|
174 `Error::getStartLine()` and `Error::setStartLine()`.
|
Chris@0
|
175 * Removed support for node cloning in the `NodeTraverser`.
|
Chris@0
|
176 * Removed `$separator` argument from `Name::toString()`.
|
Chris@0
|
177 * Removed `throw_on_error` parser option and `Parser::getErrors()` method. Use the `ErrorHandler`
|
Chris@0
|
178 mechanism instead.
|
Chris@0
|
179
|
Chris@0
|
180 Version 3.0.0-beta1 (2016-09-16)
|
Chris@0
|
181 --------------------------------
|
Chris@0
|
182
|
Chris@0
|
183 ### Added
|
Chris@0
|
184
|
Chris@0
|
185 * [7.1] Function/method and parameter builders now support PHP 7.1 type hints (void, iterable and
|
Chris@0
|
186 nullable types).
|
Chris@0
|
187 * Nodes and Comments now implement `JsonSerializable`. The node kind is stored in a `nodeType`
|
Chris@0
|
188 property.
|
Chris@0
|
189 * The `InlineHTML` node now has an `hasLeadingNewline` attribute, that specifies whether the
|
Chris@0
|
190 preceding closing tag contained a newline. The pretty printer honors this attribute.
|
Chris@0
|
191 * Partial parsing of `$obj->` (with missing property name) is now supported in error recovery mode.
|
Chris@0
|
192 * The error recovery mode is now exposed in the `php-parse` script through the `--with-recovery`
|
Chris@0
|
193 or `-r` flags.
|
Chris@0
|
194
|
Chris@0
|
195 The following changes are also part of PHP-Parser 2.1.1:
|
Chris@0
|
196
|
Chris@0
|
197 * The PHP 7 parser will now generate a parse error for `$var =& new Obj` assignments.
|
Chris@0
|
198 * Comments on free-standing code blocks will now be retained as comments on the first statement in
|
Chris@0
|
199 the code block.
|
Chris@0
|
200
|
Chris@0
|
201 Version 3.0.0-alpha1 (2016-07-25)
|
Chris@0
|
202 ---------------------------------
|
Chris@0
|
203
|
Chris@0
|
204 ### Added
|
Chris@0
|
205
|
Chris@0
|
206 * [7.1] Added support for `void` and `iterable` types. These will now be represented as strings
|
Chris@0
|
207 (instead of `Name` instances) similar to other builtin types.
|
Chris@0
|
208 * [7.1] Added support for class constant visibility. The `ClassConst` node now has a `flags` subnode
|
Chris@0
|
209 holding the visibility modifier, as well as `isPublic()`, `isProtected()` and `isPrivate()`
|
Chris@0
|
210 methods. The constructor changed to accept the additional subnode.
|
Chris@0
|
211 * [7.1] Added support for nullable types. These are represented using a new `NullableType` node
|
Chris@0
|
212 with a single `type` subnode.
|
Chris@0
|
213 * [7.1] Added support for short array destructuring syntax. This means that `Array` nodes may now
|
Chris@0
|
214 appear as the left-hand-side of assignments and foreach value targets. Additionally the array
|
Chris@0
|
215 items may now contain `null` values if elements are skipped.
|
Chris@0
|
216 * [7.1] Added support for keys in list() destructuring. The `List` subnode `vars` has been renamed
|
Chris@0
|
217 to `items` and now contains `ArrayItem`s instead of plain variables.
|
Chris@0
|
218 * [7.1] Added support for multi-catch. The `Catch` subnode `type` has been renamed to `types` and
|
Chris@0
|
219 is now an array of `Name`s.
|
Chris@0
|
220 * `Name::slice()` now supports lengths and negative offsets. This brings it in line with
|
Chris@0
|
221 `array_slice()` functionality.
|
Chris@0
|
222
|
Chris@0
|
223 ### Changed
|
Chris@0
|
224
|
Chris@0
|
225 Due to PHP 7.1 support additions described above, the node structure changed as follows:
|
Chris@0
|
226
|
Chris@0
|
227 * `void` and `iterable` types are now stored as strings if the PHP 7 parser is used.
|
Chris@0
|
228 * The `ClassConst` constructor changed to accept an additional `flags` subnode.
|
Chris@0
|
229 * The `Array` subnode `items` may now contain `null` elements (destructuring).
|
Chris@0
|
230 * The `List` subnode `vars` has been renamed to `items` and now contains `ArrayItem`s instead of
|
Chris@0
|
231 plain variables.
|
Chris@0
|
232 * The `Catch` subnode `type` has been renamed to `types` and is now an array of `Name`s.
|
Chris@0
|
233
|
Chris@0
|
234 Additionally the following changes were made:
|
Chris@0
|
235
|
Chris@0
|
236 * The `type` subnode on `Class`, `ClassMethod` and `Property` has been renamed to `flags`. The
|
Chris@0
|
237 `type` subnode has retained for backwards compatibility and is populated to the same value as
|
Chris@0
|
238 `flags`. However, writes to `type` will not update `flags`.
|
Chris@0
|
239 * The `TryCatch` subnode `finallyStmts` has been replaced with a `finally` subnode that holds an
|
Chris@0
|
240 explicit `Finally` node. This allows for more accurate attribute assignment.
|
Chris@0
|
241 * The `Trait` constructor now has the same form as the `Class` and `Interface` constructors: It
|
Chris@0
|
242 takes an array of subnodes. Unlike classes/interfaces, traits can only have a `stmts` subnode.
|
Chris@0
|
243 * The `NodeDumper` now prints class/method/property/constant modifiers, as well as the include and
|
Chris@0
|
244 use type in a textual representation, instead of only showing the number.
|
Chris@0
|
245 * All methods on `PrettyPrinter\Standard` are now protected. Previoulsy most of them were public.
|
Chris@0
|
246
|
Chris@0
|
247 ### Removed
|
Chris@0
|
248
|
Chris@0
|
249 * Removed support for running on PHP 5.4. It is however still possible to parse PHP 5.2-5.4 code
|
Chris@0
|
250 while running on a newer version.
|
Chris@0
|
251 * The deprecated `Comment::setLine()` and `Comment::setText()` methods have been removed.
|
Chris@0
|
252 * The deprecated `Name::set()`, `Name::setFirst()` and `Name::setLast()` methods have been removed.
|
Chris@0
|
253
|
Chris@0
|
254 Version 2.1.1 (2016-09-16)
|
Chris@0
|
255 --------------------------
|
Chris@0
|
256
|
Chris@0
|
257 ### Changed
|
Chris@0
|
258
|
Chris@0
|
259 * The pretty printer will now escape all control characters in the range `\x00-\x1F` inside double
|
Chris@0
|
260 quoted strings. If no special escape sequence is available, an octal escape will be used.
|
Chris@0
|
261 * The quality of the error recovery has been improved. In particular unterminated expressions should
|
Chris@0
|
262 be handled more gracefully.
|
Chris@0
|
263 * The PHP 7 parser will now generate a parse error for `$var =& new Obj` assignments.
|
Chris@0
|
264 * Comments on free-standing code blocks will no be retained as comments on the first statement in
|
Chris@0
|
265 the code block.
|
Chris@0
|
266
|
Chris@0
|
267 Version 2.1.0 (2016-04-19)
|
Chris@0
|
268 --------------------------
|
Chris@0
|
269
|
Chris@0
|
270 ### Fixed
|
Chris@0
|
271
|
Chris@0
|
272 * Properly support `B""` strings (with uppercase `B`) in a number of places.
|
Chris@0
|
273 * Fixed reformatting of indented parts in a certain non-standard comment style.
|
Chris@0
|
274
|
Chris@0
|
275 ### Added
|
Chris@0
|
276
|
Chris@0
|
277 * Added `dumpComments` option to node dumper, to enable dumping of comments associated with nodes.
|
Chris@0
|
278 * Added `Stmt\Nop` node, that is used to collect comments located at the end of a block or at the
|
Chris@0
|
279 end of a file (without a following node with which they could otherwise be associated).
|
Chris@0
|
280 * Added `kind` attribute to `Expr\Exit` to distinguish between `exit` and `die`.
|
Chris@0
|
281 * Added `kind` attribute to `Scalar\LNumber` to distinguish between decimal, binary, octal and
|
Chris@0
|
282 hexadecimal numbers.
|
Chris@0
|
283 * Added `kind` attribtue to `Expr\Array` to distinguish between `array()` and `[]`.
|
Chris@0
|
284 * Added `kind` attribute to `Scalar\String` and `Scalar\Encapsed` to distinguish between
|
Chris@0
|
285 single-quoted, double-quoted, heredoc and nowdoc string.
|
Chris@0
|
286 * Added `docLabel` attribute to `Scalar\String` and `Scalar\Encapsed`, if it is a heredoc or
|
Chris@0
|
287 nowdoc string.
|
Chris@0
|
288 * Added start file offset information to `Comment` nodes.
|
Chris@0
|
289 * Added `setReturnType()` method to function and method builders.
|
Chris@0
|
290 * Added `-h` and `--help` options to `php-parse` script.
|
Chris@0
|
291
|
Chris@0
|
292 ### Changed
|
Chris@0
|
293
|
Chris@0
|
294 * Invalid octal literals now throw a parse error in PHP 7 mode.
|
Chris@0
|
295 * The pretty printer takes all the new attributes mentioned in the previous section into account.
|
Chris@0
|
296 * The protected `AbstractPrettyPrinter::pComments()` method no longer returns a trailing newline.
|
Chris@0
|
297 * The bundled autoloader supports library files being stored in a different directory than
|
Chris@0
|
298 `PhpParser` for easier downstream distribution.
|
Chris@0
|
299
|
Chris@0
|
300 ### Deprecated
|
Chris@0
|
301
|
Chris@0
|
302 * The `Comment::setLine()` and `Comment::setText()` methods have been deprecated. Construct new
|
Chris@0
|
303 objects instead.
|
Chris@0
|
304
|
Chris@0
|
305 ### Removed
|
Chris@0
|
306
|
Chris@0
|
307 * The internal (but public) method `Scalar\LNumber::parse()` has been removed. A non-internal
|
Chris@0
|
308 `LNumber::fromString()` method has been added instead.
|
Chris@0
|
309
|
Chris@0
|
310 Version 2.0.1 (2016-02-28)
|
Chris@0
|
311 --------------------------
|
Chris@0
|
312
|
Chris@0
|
313 ### Fixed
|
Chris@0
|
314
|
Chris@0
|
315 * `declare() {}` and `declare();` are not semantically equivalent and will now result in different
|
Chris@0
|
316 ASTs. The format case will have an empty `stmts` array, while the latter will set `stmts` to
|
Chris@0
|
317 `null`.
|
Chris@0
|
318 * Magic constants are now supported as semi-reserved keywords.
|
Chris@0
|
319 * A shebang line like `#!/usr/bin/env php` is now allowed at the start of a namespaced file.
|
Chris@0
|
320 Previously this generated an exception.
|
Chris@0
|
321 * The `prettyPrintFile()` method will not strip a trailing `?>` from the raw data that follows a
|
Chris@0
|
322 `__halt_compiler()` statement.
|
Chris@0
|
323 * The `prettyPrintFile()` method will not strip an opening `<?php` if the file starts with a
|
Chris@0
|
324 comment followed by InlineHTML.
|
Chris@0
|
325
|
Chris@0
|
326 Version 2.0.0 (2015-12-04)
|
Chris@0
|
327 --------------------------
|
Chris@0
|
328
|
Chris@0
|
329 ### Changed
|
Chris@0
|
330
|
Chris@0
|
331 * String parts of encapsed strings are now represented using `Scalar\EncapsStringPart` nodes.
|
Chris@0
|
332 Previously raw strings were used. This affects the `parts` child of `Scalar\Encaps` and
|
Chris@0
|
333 `Expr\ShellExec`. The change has been done to allow assignment of attributes to encapsed string
|
Chris@0
|
334 parts.
|
Chris@0
|
335
|
Chris@0
|
336 Version 2.0.0-beta1 (2015-10-21)
|
Chris@0
|
337 --------------------------------
|
Chris@0
|
338
|
Chris@0
|
339 ### Fixed
|
Chris@0
|
340
|
Chris@0
|
341 * Fixed issue with too many newlines being stripped at the end of heredoc/nowdoc strings in some
|
Chris@0
|
342 cases. (#227)
|
Chris@0
|
343
|
Chris@0
|
344 ### Changed
|
Chris@0
|
345
|
Chris@0
|
346 * Update group use support to be in line with recent PHP 7.0 builds.
|
Chris@0
|
347 * Renamed `php-parse.php` to `php-parse` and registered it as a composer bin.
|
Chris@0
|
348 * Use composer PSR-4 autoloader instead of custom autoloader.
|
Chris@0
|
349 * Specify phpunit as a dev dependency.
|
Chris@0
|
350
|
Chris@0
|
351 ### Added
|
Chris@0
|
352
|
Chris@0
|
353 * Added `shortArraySyntax` option to pretty printer, to print all arrays using short syntax.
|
Chris@0
|
354
|
Chris@0
|
355 Version 2.0.0-alpha1 (2015-07-14)
|
Chris@0
|
356 ---------------------------------
|
Chris@0
|
357
|
Chris@0
|
358 A more detailed description of backwards incompatible changes can be found in the
|
Chris@0
|
359 [upgrading guide](UPGRADE-2.0.md).
|
Chris@0
|
360
|
Chris@0
|
361 ### Removed
|
Chris@0
|
362
|
Chris@0
|
363 * Removed support for running on PHP 5.3. It is however still possible to parse PHP 5.2 and PHP 5.3
|
Chris@0
|
364 code while running on a newer version.
|
Chris@0
|
365 * Removed legacy class name aliases. This includes the old non-namespaced class names and the old
|
Chris@0
|
366 names for classes that were renamed for PHP 7 compatibility.
|
Chris@0
|
367 * Removed support for legacy node format. All nodes must have a `getSubNodeNames()` method now.
|
Chris@0
|
368
|
Chris@0
|
369 ### Added
|
Chris@0
|
370
|
Chris@0
|
371 * Added support for remaining PHP 7 features that were not present in 1.x:
|
Chris@0
|
372 * Group use declarations. These are represented using `Stmt\GroupUse` nodes. Furthermore a `type`
|
Chris@0
|
373 attribute was added to `Stmt\UseUse` to handle mixed group use declarations.
|
Chris@0
|
374 * Uniform variable syntax.
|
Chris@0
|
375 * Generalized yield operator.
|
Chris@0
|
376 * Scalar type declarations. These are presented using `'bool'`, `'int'`, `'float'` and `'string'`
|
Chris@0
|
377 as the type. The PHP 5 parser also accepts these, however they'll be `Name` instances there.
|
Chris@0
|
378 * Unicode escape sequences.
|
Chris@0
|
379 * Added `PhpParser\ParserFactory` class, which should be used to create parser instances.
|
Chris@0
|
380 * Added `Name::concat()` which concatenates two names.
|
Chris@0
|
381 * Added `Name->slice()` which takes a subslice of a name.
|
Chris@0
|
382
|
Chris@0
|
383 ### Changed
|
Chris@0
|
384
|
Chris@0
|
385 * `PhpParser\Parser` is now an interface, implemented by `Parser\Php5`, `Parser\Php7` and
|
Chris@0
|
386 `Parser\Multiple`. The `Multiple` parser will try multiple parsers, until one succeeds.
|
Chris@0
|
387 * Token constants are now defined on `PhpParser\Parser\Tokens` rather than `PhpParser\Parser`.
|
Chris@0
|
388 * The `Name->set()`, `Name->append()`, `Name->prepend()` and `Name->setFirst()` methods are
|
Chris@0
|
389 deprecated in favor of `Name::concat()` and `Name->slice()`.
|
Chris@0
|
390 * The `NodeTraverser` no longer clones nodes by default. The old behavior can be restored by
|
Chris@0
|
391 passing `true` to the constructor.
|
Chris@0
|
392 * The constructor for `Scalar` nodes no longer has a default value. E.g. `new LNumber()` should now
|
Chris@0
|
393 be written as `new LNumber(0)`.
|
Chris@0
|
394
|
Chris@0
|
395 ---
|
Chris@0
|
396
|
Chris@0
|
397 **This changelog only includes changes from the 2.0 series. For older changes see the
|
Chris@0
|
398 [1.x series changelog](https://github.com/nikic/PHP-Parser/blob/1.x/CHANGELOG.md) and the
|
Chris@0
|
399 [0.9 series changelog](https://github.com/nikic/PHP-Parser/blob/0.9/CHANGELOG.md).** |