Open stereoit opened 7 years ago
+1
@haydentech same problem, I reached "not working, but gives no error."
+1 Do you guys have your solutions with this?
I had this same problem and googled it to here. Yep - reading instructions were key here. Follow the above directions: https://github.com/Dickurt/vscode-php-formatter/issues/17#issuecomment-343574032
Same problem "Neither a pharPath or use of Composer was specified. Aborting..." ...
PHP Windows 10 VScode
In your project press "Ctrl + ,", you will see before you "User Settings", go to "PHP Formatter Settings" and there you must change the value "phpformatter.composer" from "false" to "true"
@ArtemLazar , nothing change, just removed the error message
this worked well Solution TL; DR
There's another issue in this repo. There's the advice to look into VSCode's developer tools under Help => Toggle Developer Tools
// Add arguments to the executed fix command, like so: ['--level=psr2'
The level argument has been deprecated in the meantime.
My settings now look like
"phpformatter.composer": true,
"phpformatter.arguments": [
""
],
I tried to provide --rules psr2
and got message The rules contain unknown fixers: "psr2" (did you mean "psr0"?).
When I provide --rules psr0
it says: The rules contain risky fixers (psr0), but they are not allowed to run. Perhaps you forget to use --allow-risky option?
How do I eventually enable psr2
?
I solved this problem installing another plugin, the phpfmt
The setting "phpformatter.composer": true, worked for me.
I suggest to use phpstorm.
Doesnt Work, i recomend the extension "phpfmt" just install and fun!
Hi everyone, i found out when added the setting "phpformatter.composer": true, "phpformatter.arguments":["--rules=@PSR2"] This issue could be solved. If you didn't use composer installed, must to point the "phpformatter.pharPath" path.
Try it! Thanks.
well done!!
thank u!
phpformatter.pharPath
Hii Where I add this code. Please explain in details.
extension phpfmt is easiest one to use
This solved my issue like a charm :1st_place_medal: Just add these lines in settings.json
"php-cs-fixer.executablePath": "${extensionPath}\php-cs-fixer.phar", "[php]": { "editor.defaultFormatter": "junstyle.php-cs-fixer", "editor.formatOnSave": true }, "php-cs-fixer.rules": "@PSR2", "php-cs-fixer.formatHtml": true, "phpformatter.composer": true, "phpformatter.arguments":["--rules=@PSR2"]
yo utilicé otra extensión guiándome del siguiente link https://gist.github.com/realrashid/59d0f99ed31103ae44291f3c752240b6
after almost 5 years, this problem hasn't been fixed and the developers are not saying anything about this problem I am also experiencing this problem and there's no way or guidance on a fix. They should just take this extension down if it doesn't work
Hi friends i have same issue ,Solved by following steps 1.comment(remove) editor.defaultFormatter from settings.json 2.in code where u want to format press shift+F 3.configure formatter will come select PHPIntelephense which add "editor.defaultFormatter": "bmewburn.vscode-intelephense-client" in [php] object of setting.json file and problem solve
Why this plugin need a complex setup when all other plugins in VScode are easy to install ?
In visual studio code I've started to get the message in subject every time I save the PHP file. I working on older project with symfony 1.4.