Skip to content

Commit

Permalink
Update trailing_comma_in_multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Aug 27, 2024
1 parent d028b50 commit cca7900
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/RuleSet/Sets/Relax.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public function mainRules(): array
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']],
'single_import_per_statement' => ['group_to_single_imports' => false],
'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
// TODO: Add 'match' & 'parameters' when PHP 8.0+ is required
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments']],
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays', 'match', 'parameters']],
'unary_operator_spaces' => ['only_dec_inc' => true],
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'phpdoc_align' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Ruleset/realodixspec_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RealodixSpec
public function __construct(
public int $a,
public ?int $b = 3600, // 1 hour...
public string $c = 'Hello World!'
public string $c = 'Hello World!',
) {}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Ruleset/relax-commonbox_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function getBar()
class SingleLineEmptyBody
{
public function __construct(
int $ruleSet
int $ruleSet,
) {}

public function basic__single_line_empty_body() {}
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Ruleset/relax_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ function om_ensure_fully_multiline($a = 10,
function om_ensure_single_line(
$a = 10,
$b = 20,
$c = 30
$c = 30,
) {}
sample(
1,
Expand Down

0 comments on commit cca7900

Please sign in to comment.