kokororin / vscode-phpfmt

Integrates phpfmt into VS Code
https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt
BSD 3-Clause "New" or "Revised" License
129 stars 30 forks source link

Possible incorrect conversion of line with method name having reserved word "include" #119

Closed dranzd closed 10 months ago

dranzd commented 10 months ago

I have a class that has this method in this format:

final public function include(Documents $documents): Documents

but when I ran the formatter it converts it to

function include Documents $documents:Documents {

Is this expected?

Tech info:

Extension ID: kokororin.vscode-phpfmt (v.1.1.12) Version: 1.81.1 Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:18:39.991Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 4.15.0-20-generic

driade commented 10 months ago

Hello, good morning. Bug confirmed and fixed.

May you please run the command "phpfmt: Upgrade fmt.phar ot fmt.stub.php" and check?

Thanks.

dranzd commented 10 months ago

Hey @driade ,

That was quick, thank you! I can confirm this is now fixed.

Thanks again!

dranzd commented 10 months ago

Sorry I had to reopen again.

I just noticed now that the opening curly brace is not going on another line, so from:

    final public function include(Documents $documents): Documents {

I believe it should be

    final public function include(Documents $documents): Documents 
    {

Thanks!

driade commented 10 months ago

Thanks, fixed, may you please cofirm?

dranzd commented 10 months ago

Perfect! Thank you very much specially for fixing that quickly!