1

Here is my example code where i am having error while using phpfmt [code formatter].

function ( int | float...$numbers ): int | float {
    return array_sum( $numbers );
};

Here as we can see in the function parameter i am using Variable-length argument lists ... using this token, i am also declare the type of the variable.
Now when i am trying to save it, phpfmt code formatter make the type and ... token together which i don't want, it is create confusion for other code readers.

How can i fix that issue please help me with this as i am new to php coding.

I am using vscode as my code editor.

Here i am also provide my phpfmt vscode settings.

 "editor.formatOnSave": true,
 "phpfmt.passes": ["AlignDoubleArrow", "SpaceAroundParentheses"],
 "phpfmt.psr2": false,

I go through the phpfmt command list but i can't find any specific command for that.

I am also watch some phpfmt videos but those all are similar just showing the installation process.

3
  • Normally, for a tool used in another tool, you would check the documentation, and if you cannot find it, and think this is a bug, or there should be an option to configure it, you would open an issue on github. Here we are more adept at answering question about writing code itself, and not so much at answering question about the tools in which you write your code. Commented Mar 10 at 20:35
  • thanks @KIKOSoftware for answering my question, you are absolutely right our purpose should be help with the codes. as i am a beginner so thought the experts can solve this small issues within a sec that is why i asked. I go through that documentation but can not find a solution. If you already noticed it in that doc please let me know it will help me a lot. Thanks once again i will raise a issue on github if needed. Commented Mar 10 at 20:38
  • @KIKOSoftware thanks for suggest me to raise a issue on github, they fixed that issue. github.com/kokororin/vscode-phpfmt/issues/141 Commented Mar 11 at 7:09

0