Hi,
I installed the DEVSENSE extension in my Vscode and I configured it with the PSR12 standard, but empty lines after opening brances and before closing braces in my classes aren't trimmed.
I have the PHPCSStandards/PHP_CodeSniffer
package installed in my project and when I run the checks i get the follow result in relation to PSR12:
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
11 | ERROR | [x] Opening brace must not be followed by a blank line
| | (PSR12.Classes.OpeningBraceSpace.Found)
32 | ERROR | [x] The closing brace for the class must go on the next line
| | after the body
| | (PSR2.Classes.ClassDeclaration.CloseBraceAfterBody)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
My class looks like this:
and my settings are like this:
"[php]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "DEVSENSE.phptools-vscode"
},
"php.executablePath": "path/to/executable",
"php.format.codeStyle": "PSR-12",
I'm based on section 4.1 of PHP-FIG PSR-12: Extended Coding Style.
Did I configure something wrong or are there anything to do to apply the PSR rule?