All Versions
64
Latest Version
Avg Release Cycle
43 days
Latest Release
829 days ago
Changelog History
Page 5
Changelog History
Page 5
-
v4.0.0-alpha2 Changes
November 10, 2017โ Added
- ๐จ In the formatting-preserving pretty printer:
- Added support for changing modifiers.
- Added support for anonymous classes.
- Added support for removing from list nodes.
- Improved support for changing comments.
- โ Added start token offsets to comments.
- ๐จ In the formatting-preserving pretty printer:
-
v4.0.0-alpha1 Changes
October 18, 2017โ Added
- โ Added experimental support for format-preserving pretty-printing. In this mode formatting will be preserved for parts of the code which have not been modified.
- โ Added
replaceNodes
option toNameResolver
, defaulting to true. If this option is disabled, resolved names will be added asresolvedName
attributes, instead of replacing the original names. - โ Added
NodeFinder
class, which can be used to find nodes based on a callback or class name. This is a utility to avoid custom node visitor implementations for simple search operations. - โ Added
ClassMethod::isMagic()
method. - โ Added
BuilderFactory
methods:val()
method for creating an AST for a simple value,concat()
for creating concatenation trees,args()
for preparing function arguments. - โ Added
NameContext
class, which encapsulates theNameResolver
logic independently of the actual AST traversal. This facilitates use in other context, such as class names in doc comments. Additionally it provides an API for getting the shortest representation of a name. - โ Added
Node::setAttributes()
method. - โ Added
JsonDecoder
. This allows conversion JSON back into an AST. - โ Added
Name
methodstoLowerString()
andisSpecialClassName()
. - โ Added
Identifier
andVarLikeIdentifier
nodes, which are used in place of simple strings in many places. - โ Added
getComments()
,getStartLine()
,getEndLine()
,getStartTokenPos()
,getEndTokenPos()
,getStartFilePos()
andgetEndFilePos()
methods toNode
. These provide a more obvious access point for the already existing attributes of the same name. - โ Added
ConstExprEvaluator
to evaluate constant expressions to PHP values. - โ Added
Expr\BinaryOp::getOperatorSigil()
, returning+
forExpr\BinaryOp\Plus
, etc.
๐ Changed
- Many subnodes that previously held simple strings now use
Identifier
(orVarLikeIdentifier
) nodes. Please see the UPGRADE-4.0 file for an exhaustive list of affected nodes and some notes on possible impact. - Expression statements (
expr;
) are now represented using aStmt\Expression
node. Previously these statements were directly represented as their constituent expression. - The
name
subnode ofParam
has been renamed tovar
and now contains aVariable
rather than a plain string. - The
name
subnode ofStaticVar
has been renamed tovar
and now contains aVariable
rather than a plain string. - The
var
subnode ofClosureUse
now contains aVariable
rather than a plain string. - The
var
subnode ofCatch
now contains aVariable
rather than a plain string. - The
alias
subnode ofUseUse
is nownull
if no explicit alias is given. As such,use Foo\Bar
anduse Foo\Bar as Bar
are now represented differently. ThegetAlias()
method can be used to get the effective alias, even if it is not explicitly given.
โ Removed
- ๐ Support for running on PHP 5 and HHVM has been removed. You can however still parse code of old PHP versions (such as PHP 5.2), while running on PHP 7.
- โ Removed
type
subnode onClass
,ClassMethod
andProperty
nodes. Useflags
instead. - ๐ The
ClassConst::isStatic()
method has been removed. Constants cannot have a static modifier. - The
NodeTraverser
no longer acceptsfalse
as a return value from aleaveNode()
method.NodeTraverser::REMOVE_NODE
should be returned instead. - ๐ The
Node::setLine()
method has been removed. If you really need to, you can usesetAttribute()
instead. - The misspelled
Class_::VISIBILITY_MODIFER_MASK
constant has been dropped in favor ofClass_::VISIBILITY_MODIFIER_MASK
. - ๐ The XML serializer has been removed. As such, the classes
Serializer\XML
, andUnserializer\XML
, as well as the interfacesSerializer
andUnserializer
no longer exist. - ๐ The
BuilderAbstract
class has been removed. It's functionality is moved intoBuilderHelpers
. However, this is an internal class and should not be used directly.
-
v3.1.5 Changes
February 28, 2018๐ Fixed
- ๐ Fixed duplicate comment assignment in switch statements. (#469)
- ๐ Improve compatibility with PHP-Scoper. (#477)
-
v3.1.4 Changes
January 25, 2018๐ Fixed
- ๐ Fixed pretty printing of
-(-$x)
and+(+$x)
. (#459)
- ๐ Fixed pretty printing of
-
v3.1.3 Changes
December 26, 2017๐ Fixed
- ๐ Improve compatibility with php-scoper, by supporting prefixed namespaces in
NodeAbstract::getType()
.
- ๐ Improve compatibility with php-scoper, by supporting prefixed namespaces in
-
v3.1.2 Changes
November 04, 2017๐ Fixed
- Comments on empty blocks are now preserved on a
Stmt\Nop
node. (#382)
โ Added
- Added
kind
attribute forStmt\Namespace_
node, which is one ofKIND_SEMICOLON
orKIND_BRACED
. (#417) - โ Added
setDocComment()
method to namespace builder. (#437)
- Comments on empty blocks are now preserved on a
-
v3.1.1 Changes
September 02, 2017๐ Fixed
- ๐ Fixed syntax error on comment after brace-style namespace declaration. (#412)
- โ Added support for TraitUse statements in trait builder. (#413)
-
v3.1.0 Changes
July 28, 2017โ Added
- ๐ [PHP 7.2] Added support for trailing comma in group use statements.
- ๐ [PHP 7.2] Added support for
object
type. This meansobject
types will now be represented as a builtin type (a simple"object"
string), rather than a className
.
๐ Fixed
- ๐จ Floating-point numbers are now printed correctly if the LC_NUMERIC locale uses a comma as decimal separator.
๐ Changed
- ๐
Name::$parts
is no longer deprecated.
-
v3.0.6 Changes
June 28, 2017๐ Fixed
- Fixed the spelling of
Class_::VISIBILITY_MODIFIER_MASK
. The previous spelling ofClass_::VISIBILITY_MODIFER_MASK
is preserved for backwards compatibility. - ๐จ The pretty printing will now preserve comments inside array literals and function calls by printing the array items / function arguments on separate lines. Array literals and functions that do not contain comments are not affected.
โ Added
- โ Added
Builder\Param::makeVariadic()
.
๐ Deprecated
- ๐ The
Node::setLine()
method has been deprecated.
- Fixed the spelling of
-
v3.0.5 Changes
March 05, 2017๐ Fixed
- Name resolution of
NullableType
s is now performed earlier, so that a fully resolved signature is available when a function is entered. (#360) Error
nodes are now considered empty, while previously they extended until the token where the error occurred. This made some nodes larger than expected. (#359)- ๐ Fixed notices being thrown during error recovery in some situations. (#362)
- Name resolution of