Customize Formatting

Respecting specific coding guidelines is crucial for maintaining a consistent codebase. In case the Code Style does not fit your needs, you can customize specific formatting rules. The settings bellow override behaviour set with the "php.format.codestyle" style.

Settings: php.format.rules.* License: PREMIUM.

Customize Settings in VS Code Settings UI

custom format settings UI

Browse through all the custom rules in Visual Studio Code Settings UI. Open command palette (Ctrl+Shift+P) and type Preferences: Open User Settings (UI). Then search for php.format and you will see all the available settings, including examples.

Indentation

IndentBraces: Gets value indicating whether to indent braces

VSCode Setting: php.format.rules.indentBraces

.editorconfig Directive: php_format_indentBraces

true false
function foo()
    {
    echo "Hello";
    }
function foo()
{
    echo "Hello";
}

Spacing

Space after cast: Insert a space after a cast operator.

VSCode Setting: php.format.rules.spaceAfterCast

.editorconfig Directive: php_format_spaceAfterCast

true false
$x = (int) $obj;
$x = (int)$obj;

Space after unary not !: Insert a space after a unary not operator.

VSCode Setting: php.format.rules.spaceAfterUnaryNot

.editorconfig Directive: php_format_spaceAfterUnaryNot

true false
$x = ! $obj;
$x = !$obj;

Space around concatenation .: Insert a space around concatenation operator.

VSCode Setting: php.format.rules.spaceAroundConcatenation

.editorconfig Directive: php_format_spaceAroundConcatenation

true false
$x = $str1 . $str2;
$x = $str1.$str2;

Space before colon : in control flow statements: Insert a space before colon in control flow blocks.

VSCode Setting: php.format.rules.spaceBeforeColonInControlStatements

.editorconfig Directive: php_format_spaceBeforeColonInControlStatements

true false
if (true) :
endif;
if (true):
endif;

Space before colon : in return type: Insert a space before colon in a return type

VSCode Setting: php.format.rules.spaceBeforeColonInReturnType

.editorconfig Directive: php_format_spaceBeforeColonInReturnType

true false
function foo() : int {
}
function foo(): int {
}

Space before parentheses in arrow functions: Insert a space before arrow function parentheses.

VSCode Setting: php.format.rules.spaceBeforeParenthesesInArrowFunctions

.editorconfig Directive: php_format_spaceBeforeParenthesesInArrowFunctions

true false
$x = fn () => 1;
$x = fn() => 1;

Space before parentheses in function calls: Insert a space before parentheses in method, function and constructor call parentheses.

VSCode Setting: php.format.rules.spaceBeforeParenthesesInCalls

.editorconfig Directive: php_format_spaceBeforeParenthesesInCalls

true false
foo ();
foo();

Space before parentheses in control statements: Insert a space before parentheses in control statements.

VSCode Setting: php.format.rules.spaceBeforeParenthesesInControlStatements

.editorconfig Directive: php_format_spaceBeforeParenthesesInControlStatements

true false
if (true)
{
}
if(true)
{
}

Space before parentheses in declarations: Insert a space before parentheses in method, function and constructor declaration parentheses.

VSCode Setting: php.format.rules.spaceBeforeParenthesesInDeclarations

.editorconfig Directive: php_format_spaceBeforeParenthesesInDeclarations

true false
function foo ()
{
}
function foo()
{
}

Space within array initializer parentheses: Insert a space within array initializer parentheses.

VSCode Setting: php.format.rules.spaceWithinArrayInitilizersParens

.editorconfig Directive: php_format_spaceWithinArrayInitilizersParens

true false
$x = array( 1 => "first", 2 => "second" );
$x = array(1 => "first", 2 => "second");

Space within brackets []: Insert a space within brackets.

VSCode Setting: php.format.rules.spaceWithinBrackets

.editorconfig Directive: php_format_spaceWithinBrackets

true false
$y = $x[ 1 ];
$y = $x[1];

Space within brackets [] around expression: Insert a space within brackets around expression.

VSCode Setting: php.format.rules.spaceWithinBracketsAroundExpression

.editorconfig Directive: php_format_spaceWithinBracketsAroundExpression

true false
$y = $x[ $i + 1 ];
$y = $x[$i + 1];

Space within call parentheses: Insert a space within method, function and constructor call parentheses.

VSCode Setting: php.format.rules.spaceWithinCallParens

.editorconfig Directive: php_format_spaceWithinCallParens

true false
foo( 1, 2 );
foo(1, 2);

Space within catch parentheses: Insert a space within catch statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinCatchParens

.editorconfig Directive: php_format_spaceWithinCatchParens

true false
try { } catch ( Exception ) { }
try { } catch (Exception) { }

Space within declaration parentheses: Insert a space within method, function and constructor declaration parentheses.

VSCode Setting: php.format.rules.spaceWithinDeclParens

.editorconfig Directive: php_format_spaceWithinDeclParens

true false
function foo( $x, $y ) { }
function foo($x, $y) { }

Space within parentheses around expression: Insert a space within parentheses around expression.

VSCode Setting: php.format.rules.spaceWithinExpressionParens

.editorconfig Directive: php_format_spaceWithinExpressionParens

true false
$x = ( 1 + 2 );
$x = (1 + 2);

Space within for parentheses: Insert a space within for statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinForParens

.editorconfig Directive: php_format_spaceWithinForParens

true false
for ( $i = 0; $i < 100; $i++ ) { }
for ($i = 0; $i < 100; $i++) { }

Space within foreach parentheses: Insert a space within foreach statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinForeachParens

.editorconfig Directive: php_format_spaceWithinForeachParens

true false
foreach ( $expr as $key => $value ) { }
foreach ($expr as $key => $value) { }

Space within if parentheses: Insert a space within if statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinIfParens

.editorconfig Directive: php_format_spaceWithinIfParens

true false
if ( true ) { }
if (true) { }

Space within switch parentheses: Insert a space within switch statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinSwitchParens

.editorconfig Directive: php_format_spaceWithinSwitchParens

true false
switch ( $x ) { }
switch ($x) { }

Space within while parentheses: Insert a space within while statement header parentheses.

VSCode Setting: php.format.rules.spaceWithinWhileParens

.editorconfig Directive: php_format_spaceWithinWhileParens

true false
while ( $a != $b ) { }
while ($a != $b) { }

NewLines

catch on a new line: Place catch on a new line.

VSCode Setting: php.format.rules.catchOnNewLine

.editorconfig Directive: php_format_catchOnNewLine

true false
try
{
}
catch
{
}
finally
{
}
try
{
} catch
{
}
finally
{
}

else on a new line: Place else on a new line.

VSCode Setting: php.format.rules.elseOnNewLine

.editorconfig Directive: php_format_elseOnNewLine

true false
if (true)
{
}
else
{
}
if (true)
{
} else
{
}

Insert final newline: Inserts final newline at the end of a file.

VSCode Setting: php.format.rules.endWithNewLine

.editorconfig Directive: php_format_endWithNewLine

finally on a new line: Place finally on a new line.

VSCode Setting: php.format.rules.finallyOnNewLine

.editorconfig Directive: php_format_finallyOnNewLine

true false
try
{
}
catch
{
}
finally
{
}
try
{
} 
catch
{
} finally
{
}

Open brace on a new line for anonymous classes: Place open brace { on a new line for anonymous classes.

VSCode Setting: php.format.rules.openBraceOnNewLineForAnonymousClasses

.editorconfig Directive: php_format_openBraceOnNewLineForAnonymousClasses

true false
$c = new class extends \Foo implements
    \ArrayAccess
{
};
$c = new class extends \Foo implements
    \ArrayAccess {
};

Open brace on a new line for blocks: Place open brace { on a new line for all types of code blocks, except for those controlled by other formatting rules.

VSCode Setting: php.format.rules.openBraceOnNewLineForBlocks

.editorconfig Directive: php_format_openBraceOnNewLineForBlocks

true false
if (true)
{
}
if (true) {
}

Open brace on a new line for functions: Place open brace { on a new line for methods, functions and constructors.

VSCode Setting: php.format.rules.openBraceOnNewLineForFunctions

.editorconfig Directive: php_format_openBraceOnNewLineForFunctions

true false
function foo()
{
}
function foo() {
}

Open brace on a new line for lambda functions: Place open brace { on a new line for lambda functions.

VSCode Setting: php.format.rules.openBraceOnNewLineForLambdas

.editorconfig Directive: php_format_openBraceOnNewLineForLambdas

true false
$lambda = function ()
{
}
$lambda = function () {
}

Open brace on a new line for namespaces: Place open brace { on a new line for namespace declarations.

VSCode Setting: php.format.rules.openBraceOnNewLineForNamespaces

.editorconfig Directive: php_format_openBraceOnNewLineForNamespaces

true false
namespace A
{
}
namespace A {
}

Open brace on a new line for types: Place open brace { on a new line for types.

VSCode Setting: php.format.rules.openBraceOnNewLineForTypes

.editorconfig Directive: php_format_openBraceOnNewLineForTypes

true false
class X extends \Foo implements
    \ArrayAccess 
{
}
class X extends \Foo implements
    \ArrayAccess {
}

Wrapping

Align consecutive = assignments.: Automatically align consecutive = assignments.

VSCode Setting: php.format.rules.alignConsecutiveAssignments

.editorconfig Directive: php_format_alignConsecutiveAssignments

true false
$a     = 1;
$bbb   = 2;
$ccccc = 3;
$a = 1;
$bbb = 2;
$ccccc = 3;

Align constants: Automatically align constant declarations

VSCode Setting: php.format.rules.alignConstants

.editorconfig Directive: php_format_alignConstants

true false
class X {
    const a   = 1;
    const bb  = 2;
    const ccc = 3;
}
class X {
    const a = 1;
    const bb = 2;
    const ccc = 3;
}

Align enum cases: Automatically align assigned values in backed enumerations

VSCode Setting: php.format.rules.alignEnumCases

.editorconfig Directive: php_format_alignEnumCases

true false
enum X {
    case a   = 1;
    case bb  = 2;
    case ccc = 3;
}
enum X {
    case a = 1;
    case bb = 2;
    case ccc = 3;
}

Align match arm bodies: Automatically align the bodies (results) within match expression arms

VSCode Setting: php.format.rules.alignMatchArmBodies

.editorconfig Directive: php_format_alignMatchArmBodies

true false
match ($day) {
    'Monday'    => 'Work',
    'Tuesday'   => 'Tacos',
    'Wednesday' => 'Waffles'
};
match ($day) {
    'Monday' => 'Work',
    'Tuesday' => 'Tacos',
    'Wednesday' => 'Waffles'
};

Align properties: Automatically align properties declarations

VSCode Setting: php.format.rules.alignProperties

.editorconfig Directive: php_format_alignProperties

true false
class X {
    var       $a   = 1;
    public    $bb  = 2;
    protected $ccc = 3;
}
class X {
    var $a = 1;
    public $bb = 2;
    protected $ccc = 3;
}

Align key-value pairs: Automatically align => operators.

VSCode Setting: php.format.rules.arrayInitializersAlignKeyValuePairs

.editorconfig Directive: php_format_arrayInitializersAlignKeyValuePairs

true false
$x = [
    1    => 'foo',
    1234 => 'bar'
];
$x = [
    1 => 'foo',
    1234 => 'bar'
];

New line after last element: Place a new line after the last element when wrapping.

VSCode Setting: php.format.rules.arrayInitializersNewLineAfterLastElement

.editorconfig Directive: php_format_arrayInitializersNewLineAfterLastElement

true false
$x = [
    1,
    2
];
$x = [
    1, 
    2];

New line before first element: Place a new line before the first array element when wrapping.

VSCode Setting: php.format.rules.arrayInitializersNewLineBeforeFirstElement

.editorconfig Directive: php_format_arrayInitializersNewLineBeforeFirstElement

true false
$x = [
    1,
    2
];
$x = [1, 
    2
];

Wrap: Defines wrapping behavior for array initializers.

  • Off - No wrapping is applied
  • On every item - When this option is selected each item is placed on a new line and properly indented if the array initializer is split across multiple lines.

VSCode Setting: php.format.rules.arrayInitializersWrap

.editorconfig Directive: php_format_arrayInitializersWrap

New line after (: Place a new line after the left opening parenthesis ( when wrapping.

VSCode Setting: php.format.rules.callParametersNewLineAfterLeftParen

.editorconfig Directive: php_format_callParametersNewLineAfterLeftParen

true false
foo(
    1,
    2
);
foo(1,
    2
);

New line before ): Place a new line before the right closing parenthesis ) when wrapping.

VSCode Setting: php.format.rules.callParametersNewLineBeforeRightParen

.editorconfig Directive: php_format_callParametersNewLineBeforeRightParen

true false
foo(
    1,
    2
);
foo(
    1,
    2);

Wrap: Defines wrapping behavior for method, function and constructor call parameters.

  • Off - No wrapping is applied
  • On every item - When this option is selected each item is placed on a new line and properly indented if the call arguments are split across multiple lines.

VSCode Setting: php.format.rules.callParametersWrap

.editorconfig Directive: php_format_callParametersWrap

; on a new line: Place ; on a new line after the last element in the chained method call when wrapping.

VSCode Setting: php.format.rules.chainedMethodCallsSemicolonOnNewLine

.editorconfig Directive: php_format_chainedMethodCallsSemicolonOnNewLine

true false
$x->aaa()
    ->bbb()
;
$x->aaa()
    ->bbb();

Wrap: Defines wrapping behavior for chained method calls.

  • Off - No wrapping is applied
  • Always - When this option is selected each method call is placed on a new line and properly indented.

VSCode Setting: php.format.rules.chainedMethodCallsWrap

.editorconfig Directive: php_format_chainedMethodCallsWrap

Compact empty body into {}: Transform empty body into {} and keep it at the same line as a previous symbol, separated by single space.

VSCode Setting: php.format.rules.declCompactEmptyBody

.editorconfig Directive: php_format_declCompactEmptyBody

true false
function foo(
    $x,
    $y
) {}
function foo(
    $x,
    $y
)
{
}

Keep ) and { on one line: Keep the right closing parenthesis ) of a function or method declaration header on the one line as opening brace of the body {.

VSCode Setting: php.format.rules.declKeepRightParenAndOpenBraceOnOneLine

.editorconfig Directive: php_format_declKeepRightParenAndOpenBraceOnOneLine

true false
function foo(
    $x,
    $y
) {
}
function foo(
    $x,
    $y
)
{
}

New line after (: Place a new line after the left opening parenthesis ( of function or method declaration header when wrapping.

VSCode Setting: php.format.rules.declParametersNewLineAfterLeftParen

.editorconfig Directive: php_format_declParametersNewLineAfterLeftParen

true false
function foo(
    $x,
    $y
) {
}
function foo($x,
    $y
) {
}

New line before ): Place a new line before the right closing parenthesis ) of a function or method declaration header when wrapping.

VSCode Setting: php.format.rules.declParametersNewLineBeforeRightParen

.editorconfig Directive: php_format_declParametersNewLineBeforeRightParen

true false
function foo(
    $x,
    $y
) {
}
function foo(
    $x,
    $y) {
}

Wrap: Defines wrapping behavior for method or function declaration parameters.

  • Off - No wrapping is applied
  • On every item - When this option is selected each declaration parameter is placed on a new line and properly indented if the arguments are split across multiple lines.

VSCode Setting: php.format.rules.declParametersWrap

.editorconfig Directive: php_format_declParametersWrap

New line after (: Place a new line after the left opening parenthesis ( in a for statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.forStatementNewLineAfterLeftParen

.editorconfig Directive: php_format_forStatementNewLineAfterLeftParen

true false
for(
    $i = 0; 
    $i < 100;
    $i++
) {
}
for($i = 0; 
    $i < 100;
    $i++
) {
}

New line before ): Place a new line after the right closing parenthesis ) in a for statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.forStatementNewLineBeforeRightParen

.editorconfig Directive: php_format_forStatementNewLineBeforeRightParen

true false
for(
    $i = 0; 
    $i < 100;
    $i++
) {
}
for($i = 0; 
    $i < 100;
    $i++
) {
}

Wrap: Defines wrapping behavior for for statement.

  • Off - No wrapping is applied
  • On every item - When this option is selected each item in for statement is placed on a new line and properly indented if they are split across multiple lines.

VSCode Setting: php.format.rules.forStatementWrap

.editorconfig Directive: php_format_forStatementWrap

New line before first group use declaration: Place a new line before first group use declaration if the list of declarations is split across multiple lines.

VSCode Setting: php.format.rules.groupUseNewLineBeforeFirstDeclaration

.editorconfig Directive: php_format_groupUseNewLineBeforeFirstDeclaration

true false
use Vendor\pkg\ns\{
    ns1\A,
    ns2\B,
};
use Vendor\pkg\ns\{ns1\A,
    ns2\B,
};

Wrap: Defines wrapping behavior for group use list in type declarations.

  • Off - No wrapping is applied
  • On every item - When this option is selected each declaration in group use list is placed on a new line and properly indented if they are split across multiple lines.

VSCode Setting: php.format.rules.groupUseWrap

.editorconfig Directive: php_format_groupUseWrap

New line after (: Place a new line after the left opening parenthesis ( in a if or elseif statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.ifStatementNewLineAfterLeftParen

.editorconfig Directive: php_format_ifStatementNewLineAfterLeftParen

true false
if(
    true
) {
}
if(true
) {
}

New line before ): Place a new line after the right closing parenthesis ) in a if or elseif statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.ifStatementNewLineBeforeRightParen

.editorconfig Directive: php_format_ifStatementNewLineBeforeRightParen

true false
if(
    true
) {
}
if(
    true) {
}

Wrap: Defines wrapping behavior for implements list in type declarations.

  • Off - No wrapping is applied
  • On every item - When this option is selected each interface in implements list is placed on a new line and properly indented if they are split across multiple lines.

VSCode Setting: php.format.rules.implementsListWrap

.editorconfig Directive: php_format_implementsListWrap

Heredoc/Nowdoc Content Indentation: Ensures heredoc and nowdoc content lines are indented one level past the declaration's scope.

VSCode Setting: php.format.rules.indentHeredoc

.editorconfig Directive: php_format_indentHeredoc

true false

function example() {
    $var = <<<HEREDOC
        content
    HEREDOC;
}

function example() {
    $var = <<<HEREDOC
content
HEREDOC;
}

Inline Heredoc/Nowdoc Declaration: Place heredoc and nowdoc on the same line as declaring variable

VSCode Setting: php.format.rules.inlineHeredoc

.editorconfig Directive: php_format_inlineHeredoc

true false
$var = <<<HEREDOC
    This is a heredoc.
HEREDOC;
$var =
<<<HEREDOC
    This is a heredoc.
HEREDOC;

Keep classes on one line: Clasess are kept on one line.

VSCode Setting: php.format.rules.keepClassesOnOneLine

.editorconfig Directive: php_format_keepClassesOnOneLine

true false
class x { }
class x {
}

Keep control statements on one line: Control statements are kept on one line.

VSCode Setting: php.format.rules.keepControlStatementsOnOneLine

.editorconfig Directive: php_format_keepControlStatementsOnOneLine

true false
if ($x) return;
if ($x)
    return;

Keep functions on one line: Functions and methods are kept on one line.

VSCode Setting: php.format.rules.keepFunctionsOnOneLine

.editorconfig Directive: php_format_keepFunctionsOnOneLine

true false
function foo() { return 1; }
function foo() {
    return 1;
}

New line after implements: Place a new line after implements in type declaration if the list of interfaces is split across multiple lines.

VSCode Setting: php.format.rules.newLineAfterImplements

.editorconfig Directive: php_format_newLineAfterImplements

true false
class X implements
    A,
    B,
    C
{
}
class X implements A, 
    B, 
    C
{
}

New line after (: Place a new line after the left opening parenthesis ( in a switch statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.switchStatementNewLineAfterLeftParen

.editorconfig Directive: php_format_switchStatementNewLineAfterLeftParen

true false
switch(
    $x
) {
}
switch($x
) {
}

New line before ): Place a new line after the right closing parenthesis ) in a switch statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.switchStatementNewLineBeforeRightParen

.editorconfig Directive: php_format_switchStatementNewLineBeforeRightParen

true false
switch(
    $x
) {
}
switch(
    $x) {
}

New line after (: Place a new line after the left opening parenthesis ( in a while statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.whileStatementNewLineAfterLeftParen

.editorconfig Directive: php_format_whileStatementNewLineAfterLeftParen

true false
while(
    $x == 2
) {
}
while($x == 2
) {
}

New line before ): Place a new line after the right closing parenthesis ) in a while statement header if it's split across multiple lines.

VSCode Setting: php.format.rules.whileStatementNewLineBeforeRightParen

.editorconfig Directive: php_format_whileStatementNewLineBeforeRightParen

true false
while(
    $x == 2
) {
}
while(
    $x == 2) {
}

Conversions

Add a comma after the last array element: Automatically adds a comma after the last array element if it's not on a single line.

VSCode Setting: php.format.rules.addCommaAfterLastArrayElement

.editorconfig Directive: php_format_addCommaAfterLastArrayElement

Add a comma after the last function call parameters: Automatically adds a comma after the last function call parameter if it's not on a single line.

VSCode Setting: php.format.rules.addCommaAfterLastCallParameter

.editorconfig Directive: php_format_addCommaAfterLastCallParameter

Add a comma after the last function declaration parameters: Automatically adds a comma after the last function or method declaration parameter if it's not on a single line.

VSCode Setting: php.format.rules.addCommaAfterLastDeclParameter

.editorconfig Directive: php_format_addCommaAfterLastDeclParameter

Boolean constant casing: Defines casing for true and false constants.

  • uppercase - Changes the casing to upper case
  • lowercase - Changes the casing to lower case
  • keep - Keeps the original casing

VSCode Setting: php.format.rules.booleanConstantCasing

.editorconfig Directive: php_format_booleanConstantCasing

lowercase uppercase
true, false
TRUE, FALSE

Null constant casing: Defines casing for null constant.

  • uppercase - Changes the casing to upper case
  • lowercase - Changes the casing to lower case
  • keep - Keeps the original casing

VSCode Setting: php.format.rules.nullConstantCasing

.editorconfig Directive: php_format_nullConstantCasing

lowercase uppercase
null
NULL

BlankLines

Blank lines after class: Defines the number of blank lines after a class declaration.

VSCode Setting: php.format.rules.blankLinesAfterClass

.editorconfig Directive: php_format_blankLinesAfterClass

Blank lines after class body: Defines the number of blank lines after a class body.

VSCode Setting: php.format.rules.blankLinesAfterClassBody

.editorconfig Directive: php_format_blankLinesAfterClassBody

Blank lines after function: Defines the number of blank lines after a function declaration.

VSCode Setting: php.format.rules.blankLinesAfterFunction

.editorconfig Directive: php_format_blankLinesAfterFunction

Blank lines after method: Defines the number of blank lines after a method declaration.

VSCode Setting: php.format.rules.blankLinesAfterMethod

.editorconfig Directive: php_format_blankLinesAfterMethod

Blank lines after namespace: Defines the number of blank lines after a namespace declaration.

VSCode Setting: php.format.rules.blankLinesAfterNamespace

.editorconfig Directive: php_format_blankLinesAfterNamespace

Blank lines after use statements: Defines the number of blank lines after 'use' statements.

VSCode Setting: php.format.rules.blankLinesAfterUseStatements

.editorconfig Directive: php_format_blankLinesAfterUseStatements

Blank lines before class: Defines the number of blank lines before a class declaration.

VSCode Setting: php.format.rules.blankLinesBeforeClass

.editorconfig Directive: php_format_blankLinesBeforeClass

Blank lines before class body: Defines the number of blank lines before a class body.

VSCode Setting: php.format.rules.blankLinesBeforeClassBody

.editorconfig Directive: php_format_blankLinesBeforeClassBody

Blank lines before function: Defines the number of blank lines before a function declaration.

VSCode Setting: php.format.rules.blankLinesBeforeFunction

.editorconfig Directive: php_format_blankLinesBeforeFunction

Blank lines before function body: Defines the number of blank lines before a function body.

VSCode Setting: php.format.rules.blankLinesBeforeFunctionBody

.editorconfig Directive: php_format_blankLinesBeforeFunctionBody

Blank lines before method: Defines the number of blank lines before a method declaration.

VSCode Setting: php.format.rules.blankLinesBeforeMethod

.editorconfig Directive: php_format_blankLinesBeforeMethod

Blank lines before method body: Defines the number of blank lines before a method body.

VSCode Setting: php.format.rules.blankLinesBeforeMethodBody

.editorconfig Directive: php_format_blankLinesBeforeMethodBody

Blank lines before namespace: Defines the number of blank lines before a namespace declaration.

VSCode Setting: php.format.rules.blankLinesBeforeNamespace

.editorconfig Directive: php_format_blankLinesBeforeNamespace

Blank lines before use statements: Defines the number of blank lines before 'use' statements.

VSCode Setting: php.format.rules.blankLinesBeforeUseStatements

.editorconfig Directive: php_format_blankLinesBeforeUseStatements

Maximum blank lines in code: Defines the maximum number of consecutive blank lines allowed in the code.

VSCode Setting: php.format.rules.maxBlankLines

.editorconfig Directive: php_format_maxBlankLines