Ondrej Mirtes
f4b835f7d8
Fix PHPDoc type of namespacedName properties
2021-12-06 21:33:02 +01:00
Nikita Popov
f09f22760e
Declare namespacedName property
...
For historical reasons, this property is used by the NameResolver
(in default mode). Declare it explicitly, rather than using a doc
comment.
2021-11-27 21:02:58 +01:00
Nikita Popov
0483391aca
Introduce ComplexType base class
...
With the upcoming addition of intersection types, a type can
be Identifier|Name|NullableType|UnionType|IntersectionType, which
is quite the mouthful. Give NullableType and UnionType a common
base class ComplexType, which does not have any behavior, but
allows to write these types (and check them in instanceof) more
easily.
2021-09-02 18:35:05 +02:00
Máté Kocsis
55c4269232
Add support for new PHP 8.1 modifiers ( #796 )
...
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
Tomas Votruba
f68e1a43ff
[PHP 8.1] Add support for enums ( #758 )
...
RFC: https://wiki.php.net/rfc/enumerations
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-04-25 21:11:36 +02:00
Tomas Votruba
4c22c62783
[PHP 8.0] Add attributes support ( #661 )
...
Adds support for PHP 8 attributes, represented using `AttrGroup` nodes
containing `Attribute` nodes. The `attrGroup` subnode is added to all
nodes that can have attributes.
This is still missing FPPP support.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-09-13 21:01:17 +02:00
Nikita Popov
a98350581c
Add support for throw expression
2020-08-09 20:52:55 +02:00
TomasVotruba
b5f5313d73
[PHP 8.0] Add exception witout variable
2020-06-03 09:18:13 +02:00
Ruud Kamphuis
64f4d5b619
Add getProperty
to ClassLike
2020-02-09 22:43:42 +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
Tyson Andre
a1f72690ef
Fix harmless typos in documentation
2019-07-23 12:32:37 +02:00
Nikita Popov
993f29906b
Avoid parent constructor call during node construction
...
Instead explicitly assign the attributes. This is a minor
performance improvement.
2019-05-12 14:55:21 +02:00
Tomas Votruba
af8c729603
Add PHP 7.4 typed properties support
2019-01-05 21:34:25 +01:00
Tomas Votruba
a74b54ce8b
[cs] remove unused @var name
2018-11-20 20:31:31 +01:00
Gabriel Caruso
7f72c84122
[CS] Open class brackets in new line
2018-01-13 16:03:55 +01:00
Gabriel Caruso
a8968caa5b
[CS] Remove extra lines
2018-01-13 16:03:53 +01:00
Gabriel Caruso
248b29ecf6
Add public visibility to getType method ( #463 )
2018-01-10 18:57:48 +01:00
Gabriel Caruso
e6e8791848
Missing # in method description
2017-12-25 14:28:33 +01:00
Gabriel Caruso
4dbb02c57b
Use Null Coalesce Operator
2017-12-15 21:41:41 +01:00
Nikita Popov
1c11626f0a
Add explicit getType() methods
...
Rather than automatically deriving getType() from the class name.
2017-11-12 21:27:14 +01:00
Alexander Miertsch
ab596db285
ClassMethod stmts property can be null ( #435 )
2017-11-01 20:26:21 +01:00
Nikita Popov
5cfdc2e0a7
Merge branch '3.x'
...
Conflicts:
lib/PhpParser/Parser/Php5.php
lib/PhpParser/Parser/Php7.php
test/PhpParser/ParserTest.php
2017-09-26 18:46:44 +02:00
Nikita Popov
5a9fbca54a
Add attribute for namespace kinds ( #417 )
...
One of KIND_SEMICOLON or KIND_BRACED.
2017-09-26 18:45:05 +02:00
TomasVotruba
e2e99f269b
Add strict_types to lib code
2017-08-18 23:00:13 +02:00
Nikita Popov
7b36ca3b6c
Add isSpecialClassName() method to Identifier and Name
2017-08-15 22:59:52 +02:00
Nikita Popov
d97cc3d96e
Add toLowerString() method to Name and Identifier
...
Avoids patterns like strtolower((string) $name) when using
strict types.
2017-08-15 22:49:16 +02:00
TomasVotruba
ec535ea14e
[cs] use PHP 5.4 short array, since PHP 7.0 is min version
2017-08-13 21:14:28 +02:00
Nikita Popov
73dc35cbbd
Allow null in ClassMethod::getStmts()
2017-05-07 19:56:14 +02:00
Nikita Popov
a32e3797d4
Generate PHP 7 type annotations
2017-04-28 21:40:59 +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
888b9dcf30
Drop misspellt class constant
2017-04-27 18:28:10 +02:00
Nikita Popov
fba61390d8
Use null-coalesce operator
2017-04-24 22:32:40 +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
Matthew Brown
329e90c239
Improve doc comments
2017-02-09 20:49:52 +01:00
Nikita Popov
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
Matthew Brown
e3b87f40aa
Add non-void return types
2017-01-25 23:32:50 +01:00
Matthew Brown
7b441d2142
Fix issues reported by psalm
2017-01-23 01:06:46 +01:00
Nikita Popov
aea3a9efe4
Add @property annotations for namespacedName
2017-01-20 23:45:54 +01:00
Nikita Popov
a79306ccd9
Rename StaticVar::$name to $var
...
As it now holds a Variable
2017-01-19 23:35:31 +01:00
Nikita Popov
6238f5f9f9
Adjust code for constitent var mode
2017-01-19 23:32:49 +01:00
Nikita Popov
ced914a3b7
Update doc comments to be more specific
...
Now $stmts arrays really only contains Stmt nodes.
2017-01-19 22:49:18 +01:00
Nikita Popov
065c720c28
Merge branch 'formatPreservingPrint'
2017-01-19 21:06:32 +01:00
Nikita Popov
0c9c8d58ab
Drop deprecated $type subnodes
...
These have been replaced by $flags in 3.0
2017-01-19 21:00:44 +01:00
Nikita Popov
4d2a4d02b0
Add first shot at format preserving pretty printer
2016-12-26 18:28:49 +01:00
Nikita Popov
9b2d35d1ac
Add expression statement mode
2016-12-24 23:54:24 +01:00