Simple-PHP-Code-Parser
Simple-PHP-Code-Parser copied to clipboard
Update dependency nikic/php-parser to v5
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| nikic/php-parser | ~4.16 -> ~5.0 |
Release Notes
nikic/PHP-Parser (nikic/php-parser)
v5.6.2
Fixed
- Fixed formatting-preserving pretty-printing when changing the visibility modifier on a node that has attributes.
- Fixed
chr()deprecation warning on PHP 8.4
Added
- Added
Param::isFinal()method.
v5.6.1
Fixed
- Fixed
Param::isPublic()for parameters with asymmetric visibility keyword. - Fixed PHP 8.5 deprecation warnings for
SplObjectStoragemethods.
Added
- Added cast
kindattributes toCast\Int_,Cast\Bool_andCast\String_. These allow distinguishing the deprecated versions of these casts.
v5.6.0
Added
- [8.5] Added support for
clonewith arbitrary function arguments. This will be parsed as anExpr\FuncCallnode, instead of the usualExpr\Clone_node. - [8.5] Permit declaration of
function clonefor use in stubs. - [8.5] Added support for the pipe operator, represented by
Expr\BinaryOp\Pipe. - [8.5] Added support for the
(void)cast, represented byExpr\Cast\Void_. - [8.5] Added support for the
finalmodifier on promoted properties. - Added
CallLike::getArg()to fetch an argument by position and name.
v5.5.0
Added
- [8.5] Added support for attributes on constants.
Stmt\Const_now has anattrGroupssubnode. - Added
weakReferencesoption toNodeConnectingVisitorandParentConnectingVisitor. This will create the parent/next/prev references as WeakReferences, to avoid making the AST cyclic and thus increasing GC pressure.
Changed
- Attributes on parameters are now printed on separate lines if the pretty printer target version is PHP 7.4 or older (which is the default). This allows them to be interpreted as comments, instead of causing a parse error. Specify a target version of PHP 8.0 or newer to restore the previous behavior.
v5.4.0
Added
- Added
Property::isAbstract()andProperty::isFinal()methods. - Added
PropertyHook::isFinal()method. - Emit an error if property hook is used on declaration with multiple properties.
Fixed
- Make legacy class aliases compatible with classmap-authoritative autoloader.
-
Param::isPromoted()andParam::isPublic()now returns true for parameters that have property hooks but no explicit visibility modifier. -
PropertyHook::getStmts()now correctly desugars shortsethooks.set => $valuewill be expanded toset { $this->propertyName = $value; }. This requires thepropertyNameattribute on the hook to be set, which is now also set by the parser. If the attribute is not set,getStmts()will throw an error for short set hooks, as it is not possible to produce a correct desugaring.
v5.3.1
Added
- Added support for declaring functions with name
exitordie, to allow their use in stubs.
v5.3.0
Added
- Added
indentoption to pretty printer, which can be used to specify the indentation to use (defaulting to four spaces). This also allows using tab indentation.
Fixed
- Resolve names in
PropertyHooks in theNameResolver. - Include the trailing semicolon inside
Stmt\GroupUsenodes, making them consistent withStmt\Use_nodes. - Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting
in
ValueErrors.
v5.2.0
Added
- [8.4] Added support for
__PROPERTY__magic constant, represented using aNode\Scalar\MagicConst\Propertynode. - [8.4] Added support for property hooks, which are represented using a new
hookssubnode onNode\Stmt\PropertyandNode\Param, which contains an array ofNode\PropertyHook. - [8.4] Added support for asymmetric visibility modifiers. Property
flagscan now hold the additional bitsModifiers::PUBLIC_SET,Modifiers::PROTECTED_SETandModifiers::PRIVATE_SET. - [8.4] Added support for generalized exit function. For backwards compatibility, exit without
argument or a single plain argument continues to use a
Node\Expr\Exit_node. Otherwise (e.g. if a named argument is used) it will be represented as a plainNode\Expr\FuncCall. - Added support for passing enum values to various builder methods, like
BuilderFactory::val().
Removed
- Removed support for alternative array syntax
$array{0}from the PHP 8 parser. It is still supported by the PHP 7 parser. This is necessary in order to support property hooks.
v5.1.0
Added
- [8.4] Added support for dereferencing
newexpressions without parentheses.
Fixed
- Fixed redundant parentheses being added when pretty printing ternary expressions.
Changed
- Made some phpdoc types more precise.
v5.0.2
Fixed
- Fix handling of indentation on next line after opening PHP tag in formatting-preserving pretty printer.
Changed
- Avoid cyclic references in
Parserobjects. This means that no longer used parser objects are immediately destroyed now, instead of requiring cycle GC. - Update
PhpVersion::getNewestSupported()to report PHP 8.3 instead of PHP 8.2.
v5.0.1
Changed
- Added check to detect use of PHP-Parser with libraries that define
T_*compatibility tokens with incorrect type (such as string instead of int). This would lead toTypeErrors down the line. Now anErrorwill be thrown early to indicate the problem.
v5.0.0
See UPGRADE-5.0 for detailed migration instructions.
Fixed
- Fixed parent class of
PropertyItemandUseItem.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Quality Gate passed
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code