Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

psr12 format preset

The PSR-12 formatting standard.

[format]
preset = "psr12"

Ecosystem and target-version gates still apply. Planned rules do not run.

Enabled rules (50)

Rule Configuration Status
format/casing/constants true Ported
format/casing/keywords true Ported
format/casing/static-reference true Ported
format/casts/lowercase true Ported
format/casts/short-scalar true Ported
format/classes/definition { "inline-constructor-arguments" = false, "space-before-parenthesis" = true } Ported
format/classes/modifier-keywords true Ported
format/classes/no-blank-line-after-opening true Ported
format/classes/single-member-per-statement { "elements" = ["property"] } Ported
format/classes/single-trait-per-statement true Ported
format/comments/no-trailing-whitespace true Ported
format/control-flow/braces true Ported
format/control-flow/continuation-position true Ported
format/control-flow/elseif true Ported
format/control-flow/no-break-comment true Ported
format/control-flow/switch-case-colon true Ported
format/control-flow/switch-case-space true Ported
format/functions/argument-spacing { "after-heredoc" = false, "attribute-placement" = "ignore", "on-multiline" = "ensure-fully-multiline" } Ported
format/functions/declaration { "closure-fn-spacing" = "one" } Ported
format/functions/no-space-after-name true Ported
format/functions/return-type-spacing true Ported
format/imports/blank-line-after true Ported
format/imports/blank-line-after-namespace true Ported
format/imports/blank-line-between-groups true Ported
format/imports/blank-lines-before-namespace true Ported
format/imports/no-leading-slash true Ported
format/imports/ordered { "order" = ["class", "function", "const"], "sort" = "none" } Ported
format/imports/single-per-statement { "group-to-single-imports" = false } Ported
format/operators/binary-spacing { "default" = "at-least-single-space" } Ported
format/operators/new-parentheses { "anonymous-class" = true } Ported
format/operators/no-space-around-double-colon true Ported
format/operators/ternary-spacing true Ported
format/operators/unary-spacing { "only-dec-inc" = true } Ported
format/statements/braces-position { "allow-single-line-anonymous-functions" = false, "allow-single-line-empty-anonymous-classes" = true } Ported
format/statements/declare-equal true Ported
format/statements/one-per-line true Ported
format/statements/space-around-construct { "constructs-followed-by-a-single-space" = ["abstract", "as", "case", "catch", "class", "const-import", "do", "else", "elseif", "final", "finally", "for", "foreach", "function", "function-import", "if", "insteadof", "interface", "namespace", "new", "private", "protected", "public", "static", "switch", "trait", "try", "use", "use-lambda", "while"], "constructs-preceded-by-a-single-space" = ["as", "else", "elseif", "use-lambda"] } Ported
format/tags/blank-line-after-opening true Ported
format/tags/full-opening true Ported
format/tags/no-closing true Ported
format/types/compact-nullable true Ported
format/whitespace/encoding true Ported
format/whitespace/final-newline true Ported
format/whitespace/indentation-type true Ported
format/whitespace/inside-parentheses true Ported
format/whitespace/line-ending true Ported
format/whitespace/no-blank-line-whitespace true Ported
format/whitespace/no-extra-blank-lines { "tokens" = ["use"] } Ported
format/whitespace/no-trailing true Ported
format/whitespace/statement-indentation true Ported

Rules left off (114)

Last updated on

Was this page helpful?