- Forums
- Snippets
- Visual Code New Line Curly Braces in Intelephense Extension psr12 to K&r
This Page Contains information about Visual Code New Line Curly Braces in Intelephense Extension psr12 to K&r By ed in category Snippets with 0 Replies. [5042], Last Updated: Mon Jun 24, 2024
ed
Sat Dec 24, 2022
0 Comments
946 Visits
If you are coding in PHP and you are not used to the curly braces on a new line, but when you format your PHP, Intelephense adds a new new line automatically for the brackets, I am not used to this. Although some people say it looks cleaner, but for me I prefe to have the curly braces in the same break line.
- To change it, go to VS Code > File > Preferences > Settings.
- In the setting, type "intelep" and you will see a list on the left menu.
- Click on Extentions > intelephense
- Under intelephense > Format: Braces
- Change from psr12 to K&r
- Done
After I changed the settings, everytime I format my PHP file, the curly braces stay on in the same line:
Chage from this:
public function registerUser(Request $request)
{
do something....
}
To this:
public function registerUser(Request $request){
do something....
}