Skip to content

Commit

Permalink
Prefer prettier over Symfony style
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeniau committed Aug 27, 2024
1 parent 08106c9 commit 156a6d3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function getRules(): array
// List (array destructuring) assignment should be declared using the configured syntax.
// https://cs.symfony.com/doc/rules/list_notation/list_syntax.html
'list_syntax' => ['syntax' => 'short'],

// Replace non multibyte-safe functions with corresponding mb function.
// https://cs.symfony.com/doc/rules/alias/mb_str_functions.html
'mb_str_functions' => $this->useRisky,
Expand All @@ -120,7 +120,26 @@ public function getRules(): array
// 'allow_hidden_params' => true, // TODO activate this when available
'remove_inheritdoc' => true,
'allow_mixed' => true,
],
],

// Operators - when multiline - must always be at the beginning or at the end of the line.
// Not explicitly set in PER, use the prettier version instead of Symfony's one
// https://cs.symfony.com/doc/rules/operator/operator_linebreak.html
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'end',
],

// Ensures a single space after language constructs.
// Comparing to Symfony let prettier handle `as` like it wants
// https://cs.symfony.com/doc/rules/language_construct/single_space_around_construct.html
'single_space_around_construct' => [
'constructs_preceded_by_a_single_space' => ['use_lambda']

],

// until prettier fixes https://github.com/prettier/plugin-php/issues/2400
'single_line_empty_body' => false,

// === Doctrine ===

Expand Down Expand Up @@ -159,4 +178,3 @@ public function getRules(): array
return $out;
}
}

0 comments on commit 156a6d3

Please sign in to comment.