Skip to content

Releases: nikic/PHP-Parser

PHP-Parser 5.4.0

30 Dec 11:10
Compare
Choose a tag to compare

Added

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

PHP-Parser 5.3.1

08 Oct 18:52
Compare
Choose a tag to compare

Added

  • Added support for declaring functions with name exit or die, to allow their use in stubs.

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.