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.

  1. To change it, go to VS Code > File > Preferences > Settings.
  2. In the setting, type "intelep" and you will see a list on the left menu.
  3. Click on  Extentions > intelephense
  4. Under intelephense > Format: Braces
  5. Change from psr12 to K&r
  6. 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....
    }