History log of /PHP-Parser/lib/PhpParser/PrettyPrinter/Standard.php (Results 51 – 75 of 160)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# cf0cd600 24-Jul-2022 Nikita Popov

Improve heuristic for escaping in single quoted strings

It is idiomatic to not escape backslashes if they are followed by
a non-special character.


# 59145a44 23-Jul-2022 Nikita Popov

Treat assignments as unary operators

Assignment expressions can be viewed as unary operators where
the whole "$x =" part is the operator.


# 7bf63482 23-Jul-2022 Nikita Popov

Remove inc/dec from precedence map

Inc/dec are primitive expressions that only accept a variable
operand, rather than a general expression operand.


# a73c8ee0 23-Jul-2022 Nikita Popov

Add a phpVersion option to the pretty printer

This is currently just used to initialize the default for short
array syntax.

The default target version in 7.0, which also means t

Add a phpVersion option to the pretty printer

This is currently just used to initialize the default for short
array syntax.

The default target version in 7.0, which also means that the
default for short arrays is flipped to on.

show more ...


# 4021a63c 04-Jul-2022 MathiasReker

No superfluous elseif

Replaces superfluous elseif with if.


# 0086a261 04-Jul-2022 MathiasReker

Short scalar cast

Cast (boolean) and (integer) should be written as (bool) and (int), (double) and (real) as (float), (binary) as (string).


# b0469d12 12-Jun-2022 Nikita Popov

Rename Expr\ClosureUse -> ClosureUse

This is not a real expression, treat it similarly to Node\Arg
or Node\Param.

The old name is retained as an alias for compatibility.


# 27fe7a68 04-Jun-2022 Nikita Popov

Include space after closure use


# 87387caf 04-Jun-2022 Nikita Popov

Remove space before return type in pretty printer


# 9c5eb3cc 04-Jun-2022 Nikita Popov

Add some missing type annotations


# 08501991 12-Sep-2021 Nikita Popov

Don't make VariadicPlaceholder an expression

And don't store it in an Arg.


# 13549aa7 03-Sep-2021 Nikita Popov

Add support for first-class callables

I'm somewhat unsure about the AST structure here.
VariadicPlaceholder is not a general expression. Maybe Arg->expr
should be Expr|VariadicPlaceh

Add support for first-class callables

I'm somewhat unsure about the AST structure here.
VariadicPlaceholder is not a general expression. Maybe Arg->expr
should be Expr|VariadicPlaceholder? Or possibly the call arguments
should be an array of Arg|VariadicPlaceholder?

show more ...


# ace6c67a 02-Sep-2021 Nikita Popov

Add support for intersection types


# 3fb73520 03-Jul-2021 Bob Weinand

Add handling for Enum(Case)s in NameResolver


# ce91d139 25-Apr-2021 Nikita Popov

Make sure match is one character long


# 33d7c8d3 25-Apr-2021 Nikita Popov

Escape invalid UTF-8 in strings

To be friendlier to tooling that expects PHP files to be UTF-8
encoded, escape any sequences that are not legal under UTF-8.


# 6b409b96 25-Apr-2021 Nikita Popov

Use hex escaping for special characters in strings

Apart from \0, using the \xHH notation is more typical.


# f68e1a43 25-Apr-2021 Tomas Votruba

[PHP 8.1] Add support for enums (#758)

RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>


# 1d1bc8a3 10-Oct-2020 Anders Jürisoo

Upgrade some PrettyPrinter methods to protected

I noticed some methods in the Standard PrettyPrinter is private, can they be upgraded to `protected` to ease when extending it?


# 4c22c627 13-Sep-2020 Tomas Votruba

[PHP 8.0] Add attributes support (#661)

Adds support for PHP 8 attributes, represented using `AttrGroup` nodes
containing `Attribute` nodes. The `attrGroup` subnode is added to all
n

[PHP 8.0] Add attributes support (#661)

Adds support for PHP 8 attributes, represented using `AttrGroup` nodes
containing `Attribute` nodes. The `attrGroup` subnode is added to all
nodes that can have attributes.

This is still missing FPPP support.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

show more ...


# f9d35fe1 10-Aug-2020 Nikita Popov

Fix casing of class name


# 8bcaa426 09-Aug-2020 Nikita Popov

Add parens for new/instanceof with complex expression

This is not fully accurate because the rules for "new variables"
are different than the rules for dereferenceable LHS.


# feb6bf7a 09-Aug-2020 Nikita Popov

Wrap class const LHS in parens if necessary

This looks like a very old bug in the pretty printer that showed
up in PHP 8 tests.


# a9835058 09-Aug-2020 Nikita Popov

Add support for throw expression


# 98f7f39d 09-Aug-2020 Nikita Popov

Add named argument support

Not adding any explicit FPPP support, as I don't think add/remove
of names can be handled any better than full reformatting.


1234567