phpfmt breaking code in class variable definitions

Viewed 112

I have a problem with phpfmt.

When I define a class-variable like:

class ClassNameHere
{
    private static array $__counter = [];
}

it gets formatted to

class ClassNameHere
{
    arrayprivate static $__counter = [];
}

This obviously breaks my code. The only solution I found so far is not use the type-hint.

Does anyone know which phpfmt-pass is responsible for this or if its a bug?

Thanks in advance!

1 Answers

The current version of phpfmt does not support class property type hinting. You will need to use a different PHP formatter. I recommend trying PHP Tools extension it provides basic code formatting, IntelliSense and some more features.

Related