You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[8.5] Added support for attributes on constants. Stmt\Const_ now has an attrGroups subnode.
Added weakReferences option to NodeConnectingVisitor and ParentConnectingVisitor. 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.
Added Property::isAbstract() and Property::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() and Param::isPublic() now returns true for parameters that have property
hooks but no explicit visibility modifier.
PropertyHook::getStmts() now correctly desugars short set hooks. set => $value will be
expanded to set { $this->propertyName = $value; }. This requires the propertyName attribute
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.
Added indent option 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 the NameResolver.
Include the trailing semicolon inside Stmt\GroupUse nodes, making them consistent with Stmt\Use_ nodes.
Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting
in ValueErrors.
[8.4] Added support for __PROPERTY__ magic constant, represented using a Node\Scalar\MagicConst\Property node.
[8.4] Added support for property hooks, which are represented using a new hooks subnode on Node\Stmt\Property and Node\Param, which contains an array of Node\PropertyHook.
[8.4] Added support for asymmetric visibility modifiers. Property flags can now hold the
additional bits Modifiers::PUBLIC_SET, Modifiers::PROTECTED_SET and Modifiers::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 plain Node\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.
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 to TypeErrors down the
line. Now an Error will be thrown early to indicate the problem.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Note
Mend has cancelled the proposed renaming of the Renovate GitHub app being renamed to
mend[bot]
.This notice will be removed on 2025年10月07日.
This PR contains the following updates:
~4.16
->~5.0
Release Notes
nikic/PHP-Parser (nikic/php-parser)
v5.6.1
Compare Source
Fixed
Param::isPublic()
for parameters with asymmetric visibility keyword.SplObjectStorage
methods.Added
kind
attributes toCast\Int_
,Cast\Bool_
andCast\String_
.These allow distinguishing the deprecated versions of these casts.
v5.6.0
Compare Source
Added
clone
with arbitrary function arguments. This will be parsed as anExpr\FuncCall
node, instead of the usualExpr\Clone_
node.function clone
for use in stubs.Expr\BinaryOp\Pipe
.(void)
cast, represented byExpr\Cast\Void_
.final
modifier on promoted properties.CallLike::getArg()
to fetch an argument by position and name.v5.5.0
Compare Source
Added
Stmt\Const_
now has anattrGroups
subnode.weakReferences
option toNodeConnectingVisitor
andParentConnectingVisitor
. Thiswill create the parent/next/prev references as WeakReferences, to avoid making the AST cyclic
and thus increasing GC pressure.
Changed
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
Compare Source
Added
Property::isAbstract()
andProperty::isFinal()
methods.PropertyHook::isFinal()
method.Fixed
Param::isPromoted()
andParam::isPublic()
now returns true for parameters that have propertyhooks but no explicit visibility modifier.
PropertyHook::getStmts()
now correctly desugars shortset
hooks.set => $value
will beexpanded to
set { $this->propertyName = $value; }
. This requires thepropertyName
attributeon 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 correctdesugaring.
v5.3.1
Compare Source
Added
exit
ordie
, to allow their use in stubs.v5.3.0
Compare Source
Added
indent
option to pretty printer, which can be used to specify the indentation to use(defaulting to four spaces). This also allows using tab indentation.
Fixed
PropertyHook
s in theNameResolver
.Stmt\GroupUse
nodes, making them consistent withStmt\Use_
nodes.in
ValueError
s.v5.2.0
Compare Source
Added
__PROPERTY__
magic constant, represented using aNode\Scalar\MagicConst\Property
node.hooks
subnode onNode\Stmt\Property
andNode\Param
, which contains an array ofNode\PropertyHook
.flags
can now hold theadditional bits
Modifiers::PUBLIC_SET
,Modifiers::PROTECTED_SET
andModifiers::PRIVATE_SET
.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 plain
Node\Expr\FuncCall
.BuilderFactory::val()
.Removed
$array{0}
from the PHP 8 parser. It is stillsupported by the PHP 7 parser. This is necessary in order to support property hooks.
v5.1.0
Compare Source
Added
new
expressions without parentheses.Fixed
Changed
v5.0.2
Compare Source
Fixed
printer.
Changed
Parser
objects. This means that no longer used parser objects areimmediately destroyed now, instead of requiring cycle GC.
PhpVersion::getNewestSupported()
to report PHP 8.3 instead of PHP 8.2.v5.0.1
Compare Source
Changed
T_*
compatibility tokenswith incorrect type (such as string instead of int). This would lead to
TypeError
s down theline. Now an
Error
will be thrown early to indicate the problem.v5.0.0
Compare Source
See UPGRADE-5.0 for detailed migration instructions.
Fixed
PropertyItem
andUseItem
.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.
This PR was generated by Mend Renovate. View the repository job log.