1
0
mirror of https://github.com/nikic/PHP-Parser.git synced 2025-06-26 18:12:54 +02:00
Commit Graph

19 Commits

Author SHA1 Message Date
653757bec6 Nullable type declaration for default null value
Adds ? before type declarations for parameters with a default null value
2022-07-04 20:34:31 +02:00
9c5eb3ccba Add some missing type annotations 2022-06-04 12:48:12 +02:00
55c4269232 Add support for new PHP 8.1 modifiers ()
Implement support for readonly properties (https://wiki.php.net/rfc/readonly_properties_v2) and
final class contstants (https://wiki.php.net/rfc/final_class_const).
2021-07-21 12:43:29 +02:00
5285df8f22 [CS] Use elseif instead of else if
Conflicts:
	lib/PhpParser/TokenStream.php
2018-01-13 16:03:36 +01:00
cc328a4c9c Add get{Start,End}{Line,TokenPos,FilePos}() methods 2017-09-29 17:34:15 +02:00
d8f9173390 Add Node::getComments() method 2017-09-29 17:09:16 +02:00
e2e99f269b Add strict_types to lib code 2017-08-18 23:00:13 +02:00
a32e3797d4 Generate PHP 7 type annotations 2017-04-28 21:40:59 +02:00
b5935a4aff Fix a typo in NodeDumper for REQUIRE_ONCE () 2017-03-17 11:35:48 +01:00
bfea338d36 Update doc comments after previous comment
Make some of the type annotations more accurate, and complete the
generated doc-comments to be complete (with description and
parameter annotations.)
2017-01-26 00:16:54 +01:00
e3b87f40aa Add non-void return types 2017-01-25 23:32:50 +01:00
b02f8ac07d Add support for dumping positions in NodeDumper 2016-11-23 22:25:17 +01:00
1dea9111a2 NodeDumper: Resolve type for include/use as well 2016-07-25 14:04:04 +02:00
174e6c3cab NodeDumper: Print modifiers as strings 2016-07-25 13:53:49 +02:00
a0c216bf4b Add dumpComments option to NodeDumper
Adding this as an option to avoid breaking people's tests.

Some of the test results show pretty clearly that we are incorrectly
assigning the same comment multiple times for nested nodes (mentioned
in ).
2016-03-09 19:48:36 +01:00
a2d7e8977a Use real properties for storing subnodes
Instead of storing subnodes in a subNodes dictionary, they are
now stored as simple properties. This requires declarating the
properties, assigning them in the constructor, overriding
the getSubNodeNames() method and passing NULL to the first argument
of the NodeAbstract constructor.

[Deprecated: It's still possible to use the old mode of operation
for custom nodes by passing an array of subnodes to the constructor.]

The only behavior difference this should cause is that getSubNodeNames()
will always return the original subnode names and skip any additional
properties that were dynamically added. E.g. this means that the
"namespacedName" node added by the NameResolver visitor is not treated
as a subnode, but as a dynamic property instead.

This change improves performance and memory usage.
2015-03-09 08:54:20 +01:00
ce5c76d79b prevent a unnecessary concat
analog to b7ffdbbb92
2015-02-13 16:02:54 +01:00
b7ffdbbb92 Optimize node dumper
For very deeply nested node trees this extra concatenation makes a
huge difference...
2015-02-13 15:20:25 +01:00
f82862ec9c Port library to use namespaces, with BC for old names 2014-02-06 20:29:35 +01:00