All Versions
64
Latest Version
Avg Release Cycle
43 days
Latest Release
829 days ago

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.
  • 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 to NameResolver, defaulting to true. If this option is disabled, resolved names will be added as resolvedName 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 the NameResolver 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 methods toLowerString() and isSpecialClassName().
    • โž• Added Identifier and VarLikeIdentifier nodes, which are used in place of simple strings in many places.
    • โž• Added getComments(), getStartLine(), getEndLine(), getStartTokenPos(), getEndTokenPos(), getStartFilePos() and getEndFilePos() methods to Node. 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 + for Expr\BinaryOp\Plus, etc.

    ๐Ÿ”„ Changed

    • Many subnodes that previously held simple strings now use Identifier (or VarLikeIdentifier) 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 a Stmt\Expression node. Previously these statements were directly represented as their constituent expression.
    • The name subnode of Param has been renamed to var and now contains a Variable rather than a plain string.
    • The name subnode of StaticVar has been renamed to var and now contains a Variable rather than a plain string.
    • The var subnode of ClosureUse now contains a Variable rather than a plain string.
    • The var subnode of Catch now contains a Variable rather than a plain string.
    • The alias subnode of UseUse is now null if no explicit alias is given. As such, use Foo\Bar and use Foo\Bar as Bar are now represented differently. The getAlias() 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 on Class, ClassMethod and Property nodes. Use flags instead.
    • ๐Ÿšš The ClassConst::isStatic() method has been removed. Constants cannot have a static modifier.
    • The NodeTraverser no longer accepts false as a return value from a leaveNode() method. NodeTraverser::REMOVE_NODE should be returned instead.
    • ๐Ÿšš The Node::setLine() method has been removed. If you really need to, you can use setAttribute() instead.
    • The misspelled Class_::VISIBILITY_MODIFER_MASK constant has been dropped in favor of Class_::VISIBILITY_MODIFIER_MASK.
    • ๐Ÿšš The XML serializer has been removed. As such, the classes Serializer\XML, and Unserializer\XML, as well as the interfaces Serializer and Unserializer no longer exist.
    • ๐Ÿ— The BuilderAbstract class has been removed. It's functionality is moved into BuilderHelpers. 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)
  • v3.1.3 Changes

    December 26, 2017

    ๐Ÿ›  Fixed

    • ๐Ÿ‘Œ Improve compatibility with php-scoper, by supporting prefixed namespaces in NodeAbstract::getType().
  • 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 for Stmt\Namespace_ node, which is one of KIND_SEMICOLON or KIND_BRACED. (#417)
    • โž• Added setDocComment() method to namespace builder. (#437)
  • 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 means object types will now be represented as a builtin type (a simple "object" string), rather than a class Name.

    ๐Ÿ›  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 of Class_::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.
  • v3.0.5 Changes

    March 05, 2017

    ๐Ÿ›  Fixed

    • Name resolution of NullableTypes 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)