format/statements/space-around-construct
In the format-laravel and format-psr12 presets. Safe fix.
What it does
Ensures a single space after language constructs.
Configuration
[format.rules]
"statements/space-around-construct" = true
To skip it in some files, add a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
constructs-contain-a-single-space |
list |
yield-from |
["yield-from"] |
constructs_contain_a_single_space |
constructs-followed-by-a-single-space |
list |
abstract, as, attribute, break, case, catch, class, clone, comment, const, const-import, continue, do, echo, else, elseif, enum, extends, final, finally, for, foreach, function, function-import, global, goto, if, implements, include, include_once, instanceof, insteadof, interface, match, named-argument, namespace, new, open-tag-with-echo, php-doc, php-open, print, private, private-set, protected, protected-set, public, public-set, readonly, require, require_once, return, static, switch, throw, trait, try, type-colon, use, use-lambda, use-trait, var, while, yield, yield-from |
["abstract", "as", "attribute", "break", "case", "catch", "class", "clone", "comment", "const", "const-import", "continue", "do", "echo", "else", "elseif", "enum", "extends", "final", "finally", "for", "foreach", "function", "function-import", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "match", "named-argument", "namespace", "new", "open-tag-with-echo", "php-doc", "php-open", "print", "private", "private-set", "protected", "protected-set", "public", "public-set", "readonly", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "type-colon", "use", "use-lambda", "use-trait", "var", "while", "yield", "yield-from"] |
constructs_followed_by_a_single_space |
constructs-preceded-by-a-single-space |
list |
as, else, elseif, use-lambda |
["as", "use-lambda"] |
constructs_preceded_by_a_single_space |
Replaces
single_space_around_construct(php-cs-fixer)