Skip to content

Releases: nikic/PHP-Parser

PHP-Parser 5.3.0

29 Sep 13:59
Compare
Choose a tag to compare

Added

  • 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.

PHP-Parser 4.19.4

29 Sep 15:03
Compare
Choose a tag to compare

Fixed

  • Remove the Parser\Php8 class from PHP-Parser 5.x that was mistakenly added. It could cause errors when using something like composer preload.

PHP-Parser 4.19.3

29 Sep 14:02
Compare
Choose a tag to compare

Fixed

  • 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.

PHP-Parser 4.19.2

17 Sep 19:39
Compare
Choose a tag to compare

Added

  • Added support for passing enum values to various builder methods, like BuilderFactory::val().

PHP-Parser 5.2.0

15 Sep 16:43
Compare
Choose a tag to compare

Added

  • [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.

PHP-Parser 5.1.0

01 Jul 20:05
Compare
Choose a tag to compare

Added

  • [8.4] Added support for dereferencing new expressions without parentheses.

Fixed

  • Fixed redundant parentheses being added when pretty printing ternary expressions.

Changed

  • Made some phpdoc types more precise.

PHP-Parser 4.19.1

17 Mar 08:12
Compare
Choose a tag to compare

Fixed

  • Fixed "Optional parameter before required parameter" deprecation warning introduced in previous version.

PHP-Parser 4.19.0

16 Mar 14:51
Compare
Choose a tag to compare

Changed

  • Do not use implicitly nullable parameters, which are deprecated in PHP 8.4.
  • Remove support for running on PHP 7.0, which does not support explicitly nullable parameters.

PHP-Parser 5.0.2

05 Mar 20:53
Compare
Choose a tag to compare

Fixed

  • Fix handling of indentation on next line after opening PHP tag in formatting-preserving pretty printer.

Changed

  • Avoid cyclic references in Parser objects. 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.

PHP-Parser 5.0.1

21 Feb 19:25
Compare
Choose a tag to compare

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 to TypeErrors down the line. Now an Error will be thrown early to indicate the problem.