Prevent Line-breaks in ternary operators in Beautifier #1924
-
Hi folks ! echo (array_key_exists('url',$btn))?$btn['url']:'#'; Will become : echo array_key_exists("url", $btn)
? $btn["url"]
: "#"; Maybe it is some kind of convention, but I do not want it to do so. I couldn't find any options in defaultPreferences to add. Do you know if that's possible or should I just use a plugin for beautifying specialised in PHP ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello there! We use prettier for that and any options supported by prettier for php will work in phoenix too. see https://docs.phcode.dev/docs/Features/beautify-code If it doesn't work for you, can you suggest a PHP beautifier you use, if you have used any. We could investigate of we cam add that feature. |
Beta Was this translation helpful? Give feedback.
-
So, I think I found the problem. To quote Prettier:
Beautify should then be used with care while editing mixed HTML/PHP files. Thanks to @abose for helping with this ! |
Beta Was this translation helpful? Give feedback.
So, I think I found the problem.
Simply put, Prettier doesn't work well with mixed php/html files. Hence, this issue that appear when I do inline PHP.
To quote Prettier:
Beautify should then be used with care while editing mixed HTML/PHP files.
Thanks to @abose for helping with this !