PHP 8.6 vyšlo. DressCode na něj váš kód přepíše. Přechod na novější PHP →

Mezery

Mezeru za přetypováním nepopisujete slovy, napíšete ji: cast: '(int) $x'. Tak se v sekci spacing zapisují mezery na řádku: kolem operátorů, za čárkou, kolem -> a ::, v deklaraci typu i v komentáři.

Hodnotou je ukázka kódu v jednoduchých uvozovkách, konstrukce napsaná přesně s tou mezerou, kterou chcete, takže konfigurace vypadá jako kód, který z ní vznikne:

spacing:
	concatenation: '$a.$b'
	arrowFunction: 'fn ($x) => $x'
	cast: '(int) $x'
	catchType: 'catch (A|B $e)'

Ukázku DressCode nečte jako kód, jen ji porovná s ukázkami, které klíč zná; neznámá ukázka je chyba konfigurace a hláška vypíše ty známé. Každý klíč řídí jen mezeru, kterou jmenuje: v 'fn ($x) => $x' je to mezera za fn, mezery kolem => patří jinému klíči. Ukázka platí přesně, takže širší mezeru nepustí; víc mezer může zůstat jen tam, kde zarovnává sloupce a dovolí to skupina spacing.alignment. Vnitřek závorek se nepíše ukázkou, ale slovem: skupina spacing.padding říká pro každý druh závorek, jestli v nich mezera být musí (required), nebo nesmí (forbidden).

$label = 'Item '.$name . ' x'.$count;  // Expected no whitespace before the `.` operator. // Expected no whitespace after the `.` operator.
$double = fn($x) => $x * 2;  // Expected a single space after the `fn` keyword.
$id = (int)$row['id'];  // Expected a single space after the cast.
$label = 'Item '.$name.' x'.$count;
$double = fn ($x) => $x * 2;
$id = (int) $row['id'];

Mezery nikdy nerozhodují o zlomu řádku: mezera kolem operátoru, který stojí na zlomu, je věcí odsazení a sekce multiline, ne téhle. Kde víc mezer zarovnává sloupce, rozhodují parametry skupiny spacing.alignment (binární operátor, čárka, ternární operátor a komentář za kódem), jestli zarovnání smí zůstat; DressCode sloupce sám nikdy nezarovnává.

spacing.keyword

The space after a keyword followed by code on its line, return, new, if, function, a modifier and the words of the head of a class among them, and around a keyword continuing a statement, else, catch, finally, the while of a do, as, insteadof and the use of a closure, which stay on the line of what is before them.

  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs required, psr12 required, nette required, symfony required, laravel required · pokrývá function_declaration, single_space_around_construct, Generic.WhiteSpace.LanguageConstructSpacing, PSR12.Classes.AnonClassDeclaration, PSR12.Traits.UseDeclaration, PSR2.Classes.ClassDeclaration, PSR2.Classes.ClassDeclaration.SpaceBeforeKeyword, PSR2.ControlStructures.SwitchDeclaration, Squiz.ControlStructures.ControlSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.Functions.FunctionDeclaration

spacing.openBrace

The space before the brace or the body a structure opens on the line of its head.

  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs required, psr12 required, nette required, symfony required, laravel required · pokrývá Squiz.ControlStructures.ControlSignature

spacing.alternativeSyntax

The space before the colon of the alternative syntax and of a label, and the single space between it and the end keyword of an empty body, if ($a): endif;.

  • 'if ($a):': no space before the colon
  • 'if ($a) :': a single space before the colon
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'if ($a):', psr12 'if ($a):', nette 'if ($a):', symfony 'if ($a):', laravel keep

spacing.switchCase

The whitespace before the colon of a case.

  • 'case 1:': none before the colon
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'case 1:', psr12 'case 1:', nette 'case 1:', symfony 'case 1:', laravel 'case 1:' · pokrývá switch_case_space, PSR2.ControlStructures.SwitchDeclaration, PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE

spacing.body

The space inside the braces of a body whose code stands on their line, of a function, a closure, a property hook and an anonymous class, and of abbreviated property hooks, { get; set; }; none inside a pair of braces with nothing between them whose empty form braces.emptyBody does not decide.

  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs required, psr12 required, nette required, symfony required, laravel keep

spacing.call

The whitespace between the name of a function and its parenthesis, of a call and of a declaration alike.

  • 'foo($a, $b)': no space before the parenthesis
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'foo($a, $b)', psr12 'foo($a, $b)', nette 'foo($a, $b)', symfony 'foo($a, $b)', laravel 'foo($a, $b)' · pokrývá function_declaration, no_spaces_after_function_name, Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeOpenBracket, PSR2.Methods.FunctionCallSignature, Squiz.Functions.FunctionDeclaration

spacing.declare

The whitespace inside a declare statement.

  • 'declare(strict_types=1)': none inside
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'declare(strict_types=1)', psr12 'declare(strict_types=1)', nette 'declare(strict_types=1)', symfony 'declare(strict_types=1)', laravel 'declare(strict_types=1)' · pokrývá declare_equal_normalize, declare_parentheses, PSR12.Files.DeclareStatement

spacing.arrowFunction

The space between fn and its parenthesis.

  • 'fn($x) => $x': no space before the parenthesis
  • 'fn ($x) => $x': a single space
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'fn($x) => $x', psr12 keep, nette 'fn($x) => $x', symfony 'fn ($x) => $x', laravel 'fn ($x) => $x' · pokrývá function_declaration, SlevomatCodingStandard.Functions.ArrowFunctionDeclaration

spacing.anonymousClass

The space between class and the arguments of an anonymous class.

  • 'new class ($a)': a single space before the arguments
  • 'new class($a)': no space before the arguments
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'new class ($a)', psr12 'new class ($a)', nette 'new class ($a)', symfony 'new class($a)', laravel 'new class($a)' · pokrývá class_definition, PSR12.Classes.AnonClassDeclaration

spacing.anonymousFunction

The space between the function of a closure and its parenthesis.

  • 'function($x)': no space before the parenthesis
  • 'function ($x)': a single space
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'function ($x)', psr12 'function ($x)', nette 'function ($x)', symfony 'function ($x)', laravel 'function ($x)' · pokrývá function_declaration, Squiz.Functions.MultiLineFunctionDeclaration

spacing.padding.argument

The whitespace inside the parentheses of the arguments of a call, of new and of an attribute, and of isset(), unset(), empty() and eval().

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs forbidden, psr12 forbidden, nette forbidden, symfony forbidden, laravel forbidden · pokrývá function_declaration, no_spaces_inside_parenthesis, spaces_inside_parentheses, PSR12.Classes.AnonClassDeclaration, PSR12.ControlStructures.ControlStructureSpacing, PSR2.ControlStructures.ControlStructureSpacing, PSR2.Methods.FunctionCallSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.ControlStructures.ForLoopDeclaration

spacing.padding.parameter

The whitespace inside the parentheses of the parameters of a function, a method, a closure, an arrow function and a property hook.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs forbidden, psr12 forbidden, nette forbidden, symfony forbidden, laravel forbidden · pokrývá function_declaration, no_spaces_inside_parenthesis, spaces_inside_parentheses, PSR12.Classes.AnonClassDeclaration, PSR12.ControlStructures.ControlStructureSpacing, PSR2.ControlStructures.ControlStructureSpacing, PSR2.Methods.FunctionCallSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.ControlStructures.ForLoopDeclaration

spacing.padding.closureUse

The whitespace inside the parentheses of the use of a closure.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs forbidden, psr12 forbidden, nette forbidden, symfony forbidden, laravel forbidden · pokrývá function_declaration, no_spaces_inside_parenthesis, spaces_inside_parentheses, PSR12.Classes.AnonClassDeclaration, PSR12.ControlStructures.ControlStructureSpacing, PSR2.ControlStructures.ControlStructureSpacing, PSR2.Methods.FunctionCallSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.ControlStructures.ForLoopDeclaration

spacing.padding.controlStructure

The whitespace inside the parentheses of if, elseif, while, for, foreach, switch, match and catch.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs forbidden, psr12 forbidden, nette forbidden, symfony forbidden, laravel forbidden · pokrývá function_declaration, no_spaces_inside_parenthesis, spaces_inside_parentheses, PSR12.Classes.AnonClassDeclaration, PSR12.ControlStructures.ControlStructureSpacing, PSR2.ControlStructures.ControlStructureSpacing, PSR2.Methods.FunctionCallSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.ControlStructures.ForLoopDeclaration, Squiz.WhiteSpace.ControlStructureSpacing

spacing.padding.grouping

The whitespace inside the parentheses grouping an expression, ($a + $b) * $c.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs forbidden, psr12 forbidden, nette forbidden, symfony forbidden, laravel forbidden · pokrývá function_declaration, no_spaces_inside_parenthesis, spaces_inside_parentheses, PSR12.Classes.AnonClassDeclaration, PSR12.ControlStructures.ControlStructureSpacing, PSR2.ControlStructures.ControlStructureSpacing, PSR2.Methods.FunctionCallSignature, Squiz.ControlStructures.ForEachLoopDeclaration, Squiz.ControlStructures.ForLoopDeclaration

spacing.padding.array

The whitespace inside the brackets or the parentheses of an array.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette forbidden, symfony forbidden, laravel forbidden · pokrývá trim_array_spaces, SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace

spacing.padding.list

The whitespace inside the brackets or the parentheses of a destructuring.

  • forbidden: never there
  • required: always there
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette forbidden, symfony forbidden, laravel forbidden · pokrývá trim_array_spaces, SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace

spacing.padding.offset

The whitespace inside the brackets of an offset access and before them.

  • forbidden: never there
  • required: always there
  • exceptLiterals: a single space around an index other than a string or an integer literal, $a[ $i ] but $a[0]
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette forbidden, symfony forbidden, laravel forbidden · pokrývá no_spaces_around_offset, Squiz.Arrays.ArrayBracketSpacing

spacing.attribute

The whitespace inside the brackets of an attribute group and before the parenthesis of its arguments, and the single space between two groups on a line and after the last one.

  • '#[Foo($a)]': none inside the brackets, none before the parenthesis
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '#[Foo($a)]', psr12 keep, nette '#[Foo($a)]', symfony '#[Foo($a)]', laravel keep · pokrývá attribute_block_no_spaces

spacing.import

The space around the braces of a group use, which hug the names.

  • 'use Acme\{Foo, Bar};': no space around the braces
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'use Acme\{Foo, Bar};', psr12 'use Acme\{Foo, Bar};', nette 'use Acme\{Foo, Bar};', symfony 'use Acme\{Foo, Bar};', laravel keep

spacing.comma

The whitespace around a comma, which stays on the line of what is before it, a line ending after it being free.

  • '$a, $b': none before, a single space after
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '$a, $b', psr12 '$a, $b', nette '$a, $b', symfony '$a, $b', laravel '$a, $b' · pokrývá no_whitespace_before_comma_in_array, whitespace_after_comma_in_array, Generic.Functions.FunctionCallArgumentSpacing, Squiz.Functions.FunctionDeclarationArgumentSpacing

spacing.namedArgument

The whitespace around the colon of a named argument.

  • 'foo(name: $x)': none before the colon, a single space after
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'foo(name: $x)', psr12 keep, nette 'foo(name: $x)', symfony 'foo(name: $x)', laravel keep · pokrývá SlevomatCodingStandard.Functions.NamedArgumentSpacing

spacing.semicolon.before

The whitespace before a semicolon, which stays on the line of what it ends.

  • '$a;': no space before a semicolon
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '$a;', psr12 keep, nette '$a;', symfony '$a;', laravel '$a;' · pokrývá no_singleline_whitespace_before_semicolons, PSR12.Traits.UseDeclaration, Squiz.ControlStructures.ForLoopDeclaration, Squiz.WhiteSpace.SemicolonSpacing

spacing.semicolon.after

The whitespace after a semicolon that more code follows on its line.

  • 'for ($i = 0; $i < 5; $i++)': a single space after a semicolon
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette 'for ($i = 0; $i < 5; $i++)', symfony 'for ($i = 0; $i < 5; $i++)', laravel 'for ($i = 0; $i < 5; $i++)' · pokrývá space_after_semicolon, Squiz.ControlStructures.ForLoopDeclaration

spacing.binaryOperator

The spaces around a binary operator, an assignment, instanceof, => and the = of a default included, . being spacing.concatenation; at a line break an operator takes no space on the side of the break, an assignment and => stay on the line of what is before them, and instanceof and a comparison keep what follows them on their line, unless the line would grow too wide.

  • '$a + $b': a single space around
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '$a + $b', psr12 '$a + $b', nette '$a + $b', symfony '$a + $b', laravel '$a + $b' · pokrývá binary_operator_spaces, PSR12.Operators.OperatorSpacing, Squiz.WhiteSpace.LogicalOperatorSpacing, Squiz.WhiteSpace.OperatorSpacing

Týká se aritmetických, porovnávacích, logických a bitových operátorů, ??, přiřazení včetně += a ??=, instanceof, => a = výchozí hodnoty. Tečka má vlastní klíč concatenation, protože se u ní styly rozcházejí.

spacing:
	binaryOperator: '$a + $b'
$total=$price*$count;  // Expected at least one space before the `=` operator. // Expected at least one space after the `=` operator. // Expected at least one space before the `*` operator. // Expected at least one space after the `*` operator.
$label = $count>1 ? 'items' : 'item';  // Expected at least one space before the `>` operator. // Expected at least one space after the `>` operator.
$map = ['a'=>1, 'b' => 2];  // Expected at least one space before the double arrow. // Expected at least one space after the double arrow.
$aligned   = 1;
$alsoFine  = 2;
$total = $price * $count;
$label = $count > 1 ? 'items' : 'item';
$map = ['a' => 1, 'b' => 2];
$aligned   = 1;
$alsoFine  = 2;

Poslední dva řádky zůstaly beze změny: zarovnání mezerami dovoluje výchozí hodnota spacing.alignment.binaryOperator.

spacing.concatenation

The space around the concatenation operator, unless it sits at a line break.

  • '$a . $b': a single space around
  • '$a.$b': no space around
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '$a . $b', psr12 '$a . $b', nette '$a . $b', symfony '$a.$b', laravel '$a.$b' · pokrývá concat_space, PSR12.Operators.OperatorSpacing, Squiz.Strings.ConcatenationSpacing

spacing.ternary

The whitespace around ? and : of a ternary, and around ?: as a whole, unless the operator sits at a line break.

  • '$a ? $b : $c': whitespace around ? and :
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '$a ? $b : $c', psr12 '$a ? $b : $c', nette '$a ? $b : $c', symfony '$a ? $b : $c', laravel '$a ? $b : $c' · pokrývá ternary_operator_spaces, PSR12.Operators.OperatorSpacing

spacing.unaryOperator

The whitespace between a unary operator other than ! and its operand, which stay on one line, and inside a variable variable, $$a and ${'a'}.

  • '-$x': no space after the operator
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '-$x', psr12 '-$x', nette '-$x', symfony '-$x', laravel '-$x' · pokrývá unary_operator_spaces, Generic.WhiteSpace.IncrementDecrementSpacing, Squiz.WhiteSpace.OperatorSpacing.Unary

spacing.logicalNot

The whitespace between ! and its operand, which stay on one line.

  • '!$x': no space after the operator
  • '! $x': a single space after the operator
  • seznam těchto ukázek, kde projde každá a kód, který neodpovídá žádné, se napíše podle první
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs ['!$x', '! $x'], psr12 ['!$x', '! $x'], nette '!$x', symfony '!$x', laravel '! $x' · pokrývá not_operator_with_successor_space, not_operator_without_successor_space, unary_operator_spaces, SlevomatCodingStandard.Operators.NegationOperatorSpacing, Squiz.WhiteSpace.OperatorSpacing.Unary

spacing.cast

The space between a cast and its operand, which stays on the line of the cast.

  • '(int) $x': a single space after the cast
  • '(int)$x': no space after the cast
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '(int) $x', psr12 '(int) $x', nette '(int) $x', symfony '(int) $x', laravel '(int) $x' · pokrývá cast_spaces

spacing.reference

The whitespace between & and its operand.

  • '&$x': none between
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '&$x', psr12 '&$x', nette '&$x', symfony '&$x', laravel keep · pokrývá SlevomatCodingStandard.PHP.ReferenceSpacing

spacing.spread

The whitespace between ... and its operand.

  • '...$x': none between
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '...$x', psr12 '...$x', nette '...$x', symfony '...$x', laravel keep · pokrývá SlevomatCodingStandard.Operators.SpreadOperatorSpacing

spacing.doubleColon

The whitespace around the double colon.

  • 'Foo::bar()': none around
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette 'Foo::bar()', symfony keep, laravel 'Foo::bar()' · pokrývá no_space_around_double_colon, Squiz.WhiteSpace.ScopeKeywordSpacing

spacing.objectOperator

The whitespace around the object operator.

  • '$a->b()': none around
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette '$a->b()', symfony '$a->b()', laravel '$a->b()' · pokrývá object_operator_without_whitespace, Squiz.WhiteSpace.ObjectOperatorSpacing

spacing.typeDeclaration

The whitespace of a type declaration, which stays on one line with what it describes: none inside a type, a single space between a type and the name it declares, ): int for a return type and enum Suit: string for a backing type.

  • '?int $x': none inside a type, a single space before the name
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs '?int $x', psr12 '?int $x', nette '?int $x', symfony '?int $x', laravel '?int $x' · pokrývá compact_nullable_type_declaration, return_type_declaration, type_declaration_spaces, types_spaces, PSR12.Functions.NullableTypeDeclaration, PSR12.Functions.ReturnTypeDeclaration, SlevomatCodingStandard.Classes.BackedEnumTypeSpacing, SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing, SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing

spacing.catchType

The space around the bar between the types of a catch.

  • 'catch (A | B $e)': a single space around the bar
  • 'catch (A|B $e)': no space around the bar
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs 'catch (A|B $e)', psr12 'catch (A | B $e)', nette 'catch (A|B $e)', symfony 'catch (A|B $e)', laravel 'catch (A|B $e)'

spacing.comment.marker

The space after the marker of a comment and before the closing one, unless another / or * follows the marker, as in a //// ruler; doc comments are the matter of the phpDoc rules.

  • '// text': a single space after the marker
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette '// text', symfony '// text', laravel '// text' · pokrývá PhpCsFixerCustomFixers/comment_surrounded_by_spaces, single_line_comment_spacing

spacing.comment.afterCode

The whitespace before a comment that follows code on its line.

  • '$a; // text': at least one space
  • keep: nic se nevynucuje, kód zůstane, jak je

Výchozí keep · standardy: perCs keep, psr12 keep, nette '$a; // text', symfony '$a; // text', laravel keep

spacing.alignment.binaryOperator

The whitespace wider than a single space around an operator, aligning a column of assignments = or of array items =>; alignment is never made.

  • forbidden: never there, more whitespace collapsing to a single space
  • spaces: spaces aligning a column staying, tabs not
  • tabs: tabs aligning a column staying, spaces not
  • optional: there or not, as the author wrote it

Výchozí spaces · standardy: perCs spaces, psr12 spaces, nette spaces, symfony forbidden, laravel forbidden · pokrývá binary_operator_spaces, PSR12.Operators.OperatorSpacing, Squiz.WhiteSpace.LogicalOperatorSpacing, Squiz.WhiteSpace.OperatorSpacing

spacing:
	binaryOperator: '$a + $b'
	alignment:
		binaryOperator: forbidden
$aligned   = 1;  // Expected a single space before the `=` operator.
$alsoFine  = 2;  // Expected a single space before the `=` operator.
$aligned = 1;
$alsoFine = 2;

spacing.alignment.ternary

The whitespace wider than a single space around ? and :, aligning a column; alignment is never made.

  • forbidden: never there, more whitespace collapsing to a single space
  • optional: there or not, as the author wrote it

Výchozí optional · standardy: perCs optional, psr12 optional, nette forbidden, symfony optional, laravel optional · pokrývá ternary_operator_spaces, PSR12.Operators.OperatorSpacing

spacing.alignment.comma

The whitespace wider than a single space after a comma, aligning the columns of a table; alignment is never made.

  • forbidden: never there, more whitespace collapsing to a single space
  • spaces: spaces aligning a column staying, tabs not
  • tabs: tabs aligning a column staying, spaces not
  • optional: there or not, as the author wrote it

Výchozí tabs · standardy: perCs forbidden, psr12 forbidden, nette tabs, symfony optional, laravel optional · pokrývá no_whitespace_before_comma_in_array, whitespace_after_comma_in_array, Generic.Functions.FunctionCallArgumentSpacing, Squiz.Functions.FunctionDeclarationArgumentSpacing

spacing.alignment.comment

The whitespace wider than a single space before a comment following code, aligning a column of comments; alignment is never made.

  • forbidden: never there, more whitespace collapsing to a single space
  • optional: there or not, as the author wrote it

Výchozí optional · standardy: perCs optional, psr12 optional, nette optional, symfony optional, laravel optional

Zobrazit na GitHubu · Nahlásit problém se stránkou na GitHubu · 7. 11. 2026