Pavel Levin
8bdcb47815
Simplify ternary operator for PHP7 ( #395 )
2017-06-30 18:19:13 +02:00
Nikita Popov
46e7fea72d
Merge branch '3.x'
...
Conflicts:
test/PhpParser/Builder/ParamTest.php
2017-06-28 23:13:33 +02:00
Nikita Popov
4a7d011317
Add support for object type
2017-06-28 23:12:13 +02:00
Nikita Popov
4fea054ee0
Merge branch '3.x'
...
Conflicts:
lib/PhpParser/Parser/Php7.php
2017-06-28 23:06:38 +02:00
Nikita Popov
7f862ac21c
Add support for trailing comma in group use
2017-06-28 23:05:28 +02:00
Nikita Popov
0808939f81
Release PHP-Parser 3.0.6
2017-06-28 22:53:48 +02:00
Nikita Popov
19dde1363e
Treat special names correctly in getShortName()
...
Also change the API to accept a string rather than a FullyQualified
name instance, as this is not appropriate for symbols like "self".
2017-06-13 19:51:22 +02:00
Nikita Popov
5b43809b48
Drop HHVM support
...
Not dropping any of the HHVM workaround code yet. If someone sorts
out the Travis build, I'm fine with keeping HHVM support.
2017-06-03 15:33:25 +02:00
Nikita Popov
947574d3dc
Merge branch '3.x'
2017-06-03 15:31:50 +02:00
Nikita Popov
7bfc320bda
Switch to dist: trusty, so HHVM runs
2017-06-03 15:25:50 +02:00
Nikita Popov
7646b31907
Merge branch '3.x'
2017-06-03 15:18:44 +02:00
Nikita Popov
bc0bff3f87
Fix method name in tests
2017-06-03 15:18:23 +02:00
Romain Neutron
c28b8556f5
Fix Lexer errorHandling when there is no tokens
...
I encounter an issue when no tokens exist. An error `Undefined offset -1` is triggered.
2017-06-03 15:17:45 +02:00
xKerman
24d583d5c3
Fix example code to work ( #390 )
2017-05-28 12:35:04 +02:00
Nikita Popov
b2c6497d63
Remove undefined variable hack
...
No longer necessary, as we don't support PHP 5 anymore.
2017-05-07 19:57:24 +02:00
Nikita Popov
4e162bd0ea
Fix type annotation for List::$items
2017-05-07 19:56:14 +02:00
Nikita Popov
73dc35cbbd
Allow null in ClassMethod::getStmts()
2017-05-07 19:56:14 +02:00
Wes
b1af3d1f7d
Add Node::setAttributes() ( #385 )
2017-05-05 18:18:44 +02:00
Nikita Popov
92275bdfa8
Remove Node::setLine() method
2017-04-29 13:01:02 +02:00
Nikita Popov
56d57d472a
Merge branch '3.x'
2017-04-29 12:58:50 +02:00
Nikita Popov
3da86df48f
Deprecate Node::setLine()
2017-04-29 12:58:35 +02:00
Nikita Popov
5ec59eebe4
Fix some typos
2017-04-28 23:17:50 +02:00
Nikita Popov
a32e3797d4
Generate PHP 7 type annotations
2017-04-28 21:40:59 +02:00
Nikita Popov
e5fbdd6bda
Add upgrading notes
2017-04-28 21:23:55 +02:00
Nikita Popov
3da189769c
Distinguish between implicit/explicit alias
...
The UseUse::$alias node can now be null if an alias is not
explicitly given. As such "use Foo\Bar" and "use Foo\Bar as Bar"
are now represented differently.
The UseUse->getAlias() method replicates the previous semantics,
by returning "Bar" in both cases.
2017-04-28 21:05:01 +02:00
Nikita Popov
a6846e3b71
Always use Identifier nodes
...
The parser will now always generate Identifier nodes (for
non-namespaced identifiers). This obsoletes the useIdentifierNodes
parser option.
Node constructors still accepts strings and will implicitly create
an Identifier wrapper. Identifier implement __toString(), so that
outside of strict-mode many things continue to work without changes.
2017-04-28 20:57:32 +02:00
Nikita Popov
3b4abbfc97
Add BuilderFactors->args(Add BuilderFactors->args())
2017-04-28 18:13:06 +02:00
Nikita Popov
7f6477ed83
Combine class/non-class name resolution into single method
2017-04-28 17:18:13 +02:00
Nikita Popov
56b810e91d
Add getShortName() API
...
PHP's name resolution rules are f'ing complicated.
2017-04-28 17:10:30 +02:00
Nikita Popov
6168abd9a0
Extract name resolution logic into NameContext
...
All the generic name resolution logic is now available as a separate
class with a public API.
2017-04-27 21:06:07 +02:00
Nikita Popov
888b9dcf30
Drop misspellt class constant
2017-04-27 18:28:10 +02:00
Nikita Popov
e1ab92275c
Allow tests without assertions
2017-04-27 18:20:12 +02:00
Ekin
3c44785e82
Bump phpunit version ( #381 )
2017-04-27 18:14:07 +02:00
Nikita Popov
8635365a30
Fix some typing issues
2017-04-26 21:50:40 +02:00
Nikita Popov
ceaed32e94
Fix typo in method name
2017-04-26 21:47:31 +02:00
Nikita Popov
fba61390d8
Use null-coalesce operator
2017-04-24 22:32:40 +02:00
Nikita Popov
7bdb55f9a8
Another try at HHVM
2017-04-24 22:26:31 +02:00
Nikita Popov
b35301659b
Try to enable php7 mode for hhvm on travis
2017-04-24 22:22:54 +02:00
Nikita Popov
60f1504978
Drop emulative lexer implementation
...
Nothing to emulate anymore... Revert this commit when something
turns up.
2017-04-24 22:15:50 +02:00
Nikita Popov
aa75838a5f
Bump minimum PHP version to 7.0
2017-04-24 22:12:03 +02:00
Nikita Popov
5f7070e94f
Added BuilderFactory->concat() method
2017-04-24 21:42:59 +02:00
Nikita Popov
8f40eec122
Add BuilderFactory->val() method
2017-04-24 21:28:03 +02:00
Nikita Popov
e4f493cd1d
Replace func_get_args() with variadics
...
We're on PHP 5.6 now, so can do this...
2017-04-24 21:19:08 +02:00
Nikita Popov
7419649eae
Change BuilderAbstract into BuilderHelpers static class
...
Used as poor man's function namespace here.
2017-04-24 21:15:11 +02:00
Nikita Popov
6b6c903585
Kill the BuilderAbstract::$flags property
...
Instead pass and return the flags explicitly.
2017-04-24 21:06:54 +02:00
Andreev Sergey
9dc93aafaa
Add ClassMethod::isMagic() method
2017-04-23 13:54:17 +02:00
Nikita Popov
ba85da88a0
Merge branch '3.x'
2017-04-19 11:20:32 +02:00
Nikita Popov
901b895c02
Fix spelling of VISIBILITY_MODIFIER_MASK
2017-04-19 11:20:05 +02:00
Nikita Popov
55be521ff8
Merge branch '3.x'
...
Conflicts:
lib/PhpParser/Builder/Param.php
2017-04-19 11:17:52 +02:00
SignpostMarv
c877c1a64f
Add Builder\Param::makeVariadic()
2017-04-19 11:16:29 +02:00