title: VS Code PHP auto-formatting / beautify with Stroustrup style braces (K&R variant) and spaces in parentheses?
body: <p><em>Help me Stack Overflow, you are my only hope.</em></p>
  
  <p>I’d like to apply auto-formatting in VS Code to PHP files with the following rules:</p>
  
  <ul>
  <li>Stroustrup style braces (K&amp;R variant)</li>
  <li>space before conditional</li>
  <li>space after function</li>
  <li>spaces in parentheses</li>
  </ul>
  
  <p>Example in the screenshot.<a href="https://i.stack.imgur.com/OsXg0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OsXg0.png" alt="Stroustrup braces and spaces"></a></p>
  
  <p>I <em>don't</em> want to apply PSR-1 or PSR-2 or PSR-12 or CakePHP or WordPress standards.</p>
  
  <p>I've struggled with:</p>
  
  <ul>
  <li>VS code internal PHP formatter</li>
  <li><a href="https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt" rel="noreferrer">phpfmt</a> (which has been last updated in 2018 and archived on GitHub)</li>
  <li>PHP Intelephense (which has little to do with formatting, as far as I can tell)</li>
  </ul>
  
  <p>phpfmt is the closest, but super-buggy.</p>
  
  <p>VS Code settings wise, I roll with:</p>
  
  <ul>
  <li>"files.autoSave": "onFocusChange",</li>
  <li>"editor.formatOnSave": true,</li>
  </ul>
  
  <p>So I'd like to instantly beautify my PHP files, please.</p>
  
  <p>Thank you for any ideas!</p>