vscode-phpfmt icon indicating copy to clipboard operation
vscode-phpfmt copied to clipboard

Alt + Shift + F Formatting Adds Unwanted Underscores to Static Variables

Open bryanwrightscode opened this issue 6 years ago • 1 comments

Issue Description

When I format a php file using Alt + Shift + F, two private static variables' declared names are changed without warning or explanation. Specifically for each of the 2 variable names, two underscores each are added to the beginning of the variable name.

Variables Before Formatting

    private static $config;
    private static $debugLog;

Variables After Formatting

    private static $__config;
    private static $__debugLog;

I could not find a similar issue when searching for "underscore" in any of title, body, or comments. Please review and if already reported direct me to the Issue No. or related pull request. Otherwise, could this please be investigated as a possible bug? Lastly, if this is an intended design of the formatter, please direct me to where this behavior is documented.

bryanwrightscode avatar Jun 07 '19 16:06 bryanwrightscode

VS Code Console Output

Output from phpfmt in VS Code when formatting the file as explained above:

php "C:\Users\bwright\.vscode\extensions\kokororin.vscode-phpfmt-1.0.30\node_modules\phpfmt\fmt.phar" --psr2 --indent_with_space=4 --cakephp C:\Users\bwright\AppData\Local\Temp\temp-sjsolgmoi.php

bryanwrightscode avatar Jun 07 '19 16:06 bryanwrightscode