1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-26 20:04:48 +01:00
Commit Graph

274 Commits

Author SHA1 Message Date
Sebastian Bergmann
f545f18a87
Add ParentConnectingVisitor and NodeConnectingVisitor (#681) 2020-07-11 11:31:43 +02:00
Nikita Popov
4abc531213 Canonicalize to PHP 8 comment token format
The trailing newline is no longer part of the comment token.
2020-06-27 18:53:09 +02:00
TomasVotruba
b58b19ed1d Add constructor promotion support 2020-06-27 17:57:47 +02:00
Máté Kocsis
32f89662f3 Add support for the mixed type 2020-05-28 23:39:04 +02:00
Nikita Popov
3ec87ef757 Don't require doc comment to be last comment
Fixes #652.
2020-02-15 10:52:34 +01:00
Ruud Kamphuis
64f4d5b619 Add getProperty to ClassLike 2020-02-09 22:43:42 +01:00
Nikita Popov
602af9060d Add end line / file position / token position to comments 2020-02-09 16:53:46 +01:00
Tomáš Votruba
88f3a669c1 Add union type to ParamBuilder and BuilderHelpers 2020-01-05 00:34:49 +01:00
Nikita Popov
664c10121e Add support for union types
We definitely need to introduce a general "Type" abstraction in
the next major version.
2019-11-08 14:45:32 +01:00
Tomas Votruba
006acba066 add getTraitUses() method to ClassLike 2019-08-31 09:26:51 +02:00
Tomas Votruba
005bb1dba7 add getProperties() and getConstants() to ClassLike 2019-08-30 20:47:14 +02:00
Tomáš Votruba
3f718ee2c3 [PHP 7.4] Add support for numeric literal separators (#615)
Implements RFC https://wiki.php.net/rfc/numeric_literal_separator.

Closes #614.
2019-06-30 12:13:28 +02:00
Nikita Popov
9484baf8f8 Make compatible with PhpUnit 8 2019-06-23 15:03:40 +02:00
hoels
624f71fa6f Resolve return type of arrow functions (#613) 2019-06-04 16:25:12 +02:00
Tomas Votruba
8012faea54 [PHP 7.4] Add array spread 2019-05-09 19:15:35 +02:00
Tomáš Votruba
f3b19c19ef [PHP 7.4] Add support for arrow functions (#602)
Per RFC https://wiki.php.net/rfc/arrow_functions_v2.
2019-05-09 14:17:28 +02:00
Tomas Votruba
9de96821f7 Add support for ??= operator
Introduced in PHP 5.4, represented using an AssignOp\Coalesce node.
2019-02-09 11:16:26 +01:00
Lars Moelleken
b7e6361536 updates via "rectorphp/rector" (#573)
- "global" -> remove unused "use" statements
- "phpunit" -> fix "@covers" comments
- "phpunit" -> replace "->will($this->returnValue()" with "->willReturn()"
- "UseTest.php" -> add missing namespace
- "composer.json" -> use "autoload-dev"
- remove -> "require_once" usage in the tests (use autoload-dev via composer.json)

-> most of the changes are done automatically by "https://github.com/rectorphp/rector"
2019-01-19 11:18:00 +01:00
Tomas Votruba
af8c729603 Add PHP 7.4 typed properties support 2019-01-05 21:34:25 +01:00
Tomas Votruba
0ef61b49bb add float/double/real KIND support to Cast\Double node 2019-01-05 19:23:00 +01:00
Maks Rafalko
dc323458b4 Add new constant to be returned from enterNode() to not traverse current and child nodes (#536)
* Add new constant to be returned from enterNode() to not travers current node for subsequent visitors and skip children traversing

* Allow visitors to replace nodes in leaveNode() when DONT_TRAVERSE_CURRENT_AND_CHILDREN is used
2018-10-08 22:26:00 +02:00
Tomáš Votruba
d638dd9b25 Use methods instead of annotations for expected exceptions (#533) 2018-09-22 10:43:54 +02:00
Nikita Popov
eebaa94647 Flexible doc strings: Fix some issues, add more tests 2018-09-22 10:09:00 +02:00
Nikita Popov
a5c726bfbf Make sure heredoc end label not followed by label char 2018-09-21 11:44:39 +02:00
Nikita Popov
83766c8c0e Partial support for flexible heredoc/nowdoc
This only implements the token emulation part, it does not yet
handle the indentation stripping.

Emulating this feature on old PHP versions is really tough and is
not going to work perfectly, but hopefully this implementation is
"good enough".
2018-09-21 11:16:00 +02:00
Nikita Popov
16c5d107ca Revert "Add check for leading backslash in Name ctor"
This reverts commit 2f67429ec9.

Reverting this to avoid a BC break in a patch release, will
reapply for the next major version.
2018-09-18 09:00:32 +02:00
Nikita Popov
41408081d7 Rename setTypeHint() to setType()
To align with modern terminology -- we don't like calling these
type hints anymore. Old method name remains, marked as @deprecated.
2018-07-22 21:41:21 +02:00
ProgMiner
d4a5a6e84b Add tests for Builder\TraitUseAdaptation 2018-07-22 21:23:00 +02:00
ProgMiner
c55798ccc6 Add tests for Builder\TraitUse 2018-07-22 21:23:00 +02:00
ProgMiner
82e8b33814 Add some trait use factory builder integration tests 2018-07-22 21:23:00 +02:00
Nikita Popov
3e02eb7108 Fix updateTests.php 2018-07-22 21:18:34 +02:00
Nikita Popov
2f67429ec9 Add check for leading backslash in Name ctor
Fixes #523.
2018-07-21 21:58:32 +02:00
Nikita Popov
0cd7207ca6 Add tests for var() and propertyFetch() 2018-07-20 21:59:42 +02:00
Nikita Popov
b855c1ca23 Add some tests for new use builders 2018-07-20 21:44:37 +02:00
Nikita Popov
6526ea2497 Throw when printin EncapsedStringPart
This needs to go through something like Encapsed or ShellExec to
determine quotation type. Explicitly throw an exception to avoid
getting an undefined method error.
2018-06-03 13:31:00 +02:00
Gabriel Caruso
21d27527ed Use dedicated assertNull assertion (#503) 2018-05-19 11:12:07 +02:00
Nikita Popov
610617fe93 Also add new() builder 2018-03-03 22:25:58 +01:00
Nikita Popov
ff2d85dc6b Add constFetch() and classConstFetch() builders 2018-03-03 22:14:42 +01:00
Nikita Popov
b998d1e9b5 Add funcCall(), methodCall() and staticCall() builders 2018-03-03 15:40:51 +01:00
Nikita Popov
6aba7624ed Add replacement sanity check in traverser 2018-03-03 13:22:36 +01:00
Nikita Popov
a513ccabb7 Improve constant evaluation and add docs
Split into evaluateDirectly() and evaluateSilently(), to be able
to treat errors more gracefully. Add documentation for constant
evaluation.
2018-01-27 17:47:45 +01:00
Nikita Popov
6a273c9fbd Remove Autoloader class 2018-01-25 23:13:53 +01:00
Gabriel Caruso
edafeb85c4 [CS] Order uses A -> Z 2018-01-13 16:08:27 +01:00
Gabriel Caruso
68d07c4662 [CS] New line in the end of file 2018-01-13 16:08:26 +01:00
Gabriel Caruso
8fae99aafe [CS] Remove spaces 2018-01-13 16:08:25 +01:00
Nikita Popov
c7ada124d0 [CS] Use ::class notation instead of string
Conflicts:
	test/PhpParser/ParserFactoryTest.php
	test/PhpParser/ParserTest.php
2018-01-13 16:08:17 +01:00
Gabriel Caruso
e0a2043089 [CS] Space before casting 2018-01-13 16:03:57 +01:00
Gabriel Caruso
7f72c84122 [CS] Open class brackets in new line 2018-01-13 16:03:55 +01:00
Nikita Popov
5285df8f22 [CS] Use elseif instead of else if
Conflicts:
	lib/PhpParser/TokenStream.php
2018-01-13 16:03:36 +01:00
Gabriel Caruso
83b958763f Refactoring tests 2017-12-15 21:42:34 +01:00