|
| 1 | +Version 0.9.3-dev |
| 2 | +----------------- |
| 3 | + |
| 4 | +Nothing yet. |
| 5 | + |
| 6 | +Version 0.9.2 (07.07.2012) |
| 7 | +-------------------------- |
| 8 | +* Add `Class->getMethods()` function, which returns all methods contained in the `stmts` array of the class node. This |
| 9 | + does not take inherited methods into account. |
| 10 | + |
| 11 | +* Add `isPublic()`, `isProtected()`, `isPrivate()`. `isAbstract()`, `isFinal()` and `isStatic()` accessors to the |
| 12 | + `ClassMethod`, `Property` and `Class` nodes. (`Property` and `Class` obviously only have the accessors relevant to |
| 13 | + them.) |
| 14 | + |
| 15 | +* Fix parsing of new expressions in parentheses, e.g. `return(new Foo);`. |
| 16 | + |
| 17 | +* [BC] Due to the below changes nodes now optionally accept an `$attributes` array as the |
| 18 | + last parameter, instead of the previously used `$line` and `$docComment` parameters. |
| 19 | + |
| 20 | +* Add mechanism for adding attributes to nodes in the lexer. |
| 21 | + |
| 22 | + The following attributes are now added by default: |
| 23 | + |
| 24 | + * `startLine`: The line the node started in. |
| 25 | + * `endLine`: The line the node ended in. |
| 26 | + * `comments`: An array of comments. The comments are instances of `PHPParser_Comment` |
| 27 | + (or `PHPParser_Comment_Doc` for doc comments). |
| 28 | + |
| 29 | + The methods `getLine()` and `setLine()` still exist and function as before, but internally |
| 30 | + operator on the `startLine` attribute. |
| 31 | + |
| 32 | + `getDocComment()` also continues to exist. It returns the last comment in the `comments` |
| 33 | + attribute if it is a doc comment, otherwise `null`. As `getDocComment()` now returns a |
| 34 | + comment object (which can be modified using `->setText()`) the `setDocComment()` method was |
| 35 | + removed. Comment objects implement a `__toString()` method, so `getDocComment()` should |
| 36 | + continue to work properly with old code. |
| 37 | + |
| 38 | +* [BC] Use inject-once approach for lexer: |
| 39 | + |
| 40 | + Now the lexer is injected only once when creating the parser. Instead of |
| 41 | + |
| 42 | + $parser = new PHPParser_Parser; |
| 43 | + $parser->parse(new PHPParser_Lexer($code)); |
| 44 | + $parser->parse(new PHPParser_Lexer($code2)); |
| 45 | + |
| 46 | + you write: |
| 47 | + |
| 48 | + $parser = new PHPParser_Parser(new PHPParser_Lexer); |
| 49 | + $parser->parse($code); |
| 50 | + $parser->parse($code2); |
| 51 | + |
| 52 | +* Fix `NameResolver` visitor to also resolve class names in `catch` blocks. |
| 53 | + |
| 54 | +Version 0.9.1 (24.04.2012) |
| 55 | +-------------------------- |
| 56 | + |
| 57 | +* Add ability to add attributes to nodes: |
| 58 | + |
| 59 | + It is now possible to add attributes to a node using `$node->setAttribute('name', 'value')` and to retrieve them using |
| 60 | + `$node->getAttribute('name' [, 'default'])`. Additionally the existance of an attribute can be checked with |
| 61 | + `$node->hasAttribute('name')` and all attributes can be returned using `$node->getAttributes()`. |
| 62 | + |
| 63 | +* Add code generation features: Builders and templates. |
| 64 | + |
| 65 | + For more infos, see the [code generation documentation][1]. |
| 66 | + |
| 67 | +* [BC] Don't traverse nodes merged by another visitor: |
| 68 | + |
| 69 | + If a NodeVisitor returns an array of nodes to merge, these will no longer be traversed by all other visitors. This |
| 70 | + behavior only caused problems. |
| 71 | + |
| 72 | +* Fix line numbers for some list structures. |
| 73 | +* Fix XML unserialization of empty nodes. |
| 74 | +* Fix parsing of integers that overflow into floats. |
| 75 | +* Fix emulation of NOWDOC and binary floats. |
| 76 | + |
| 77 | +Version 0.9.0 (05.01.2012) |
| 78 | +-------------------------- |
| 79 | + |
| 80 | +First version. |
| 81 | + |
| 82 | + [1]: https://github.com/nikic/PHP-Parser/blob/master/doc/3_Code_generation.markdown |
0 commit comments