-
Notifications
You must be signed in to change notification settings - Fork 25
Description
I use PSR12, which extends previous standards like PSR1 and PSR2:
"php.format.codeStyle": "PSR-12",
So by default the extension should use this standard in formatting, but it looks like extension settings, even if not set, override chosen standard. First of all you might want to add null to acceptable value types to avoid warnings (unless it's a bug within VSCode itself):

Even though I don't set any styling rules in settings.json (means this should be null and the rule directly from PSR12 standard should be used) and I don't even have premium active, these rules are used anyway like they were true instead of null:
For example:
if (isset($myVar)) {
...
}
if (!empty($myVar)) {
...
{is formatted as
if (isset ($myVar)) {
...
}
if (!empty ($myVar)) {
...
{It breaks rule PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket:
These are control structures:
- if
- else
- elseif/else if
- while
- do-while
- for
- foreach
- break
- continue
- switch
- match
- declare
- return
- require
- include
- require_once
- include_once
- goto
Of course I'm just guessing that's the rule causing this problem here. It would really help with debugging these if there was code style inspection available 🙏 Something like PHP Sniffer extension has:
showing specific rule that triggers styling error:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status



