Skip to content

Commit

Permalink
Upgrade Php-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
nikrou committed Nov 9, 2021
1 parent 667536b commit 14d3ae0
Show file tree
Hide file tree
Showing 5 changed files with 543 additions and 622 deletions.
52 changes: 33 additions & 19 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,50 @@

return $config
->setRules([
'blank_line_after_opening_tag' => true,
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
'array_syntax' => ['syntax' => 'short'], // long
'whitespace_after_comma_in_array' => true,
'@PSR1' => true,

// arrays
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_whitespace_before_comma_in_array' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => true,

// class
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'class_definition' => ['single_line' => true],
'method_argument_space' => true,

// comments
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
'header_comment' => ['comment_type' => 'comment', 'header' => $header, 'location' => 'after_open', 'separate' => 'bottom'],
'no_trailing_whitespace' => true,
'single_line_comment_style' => true,

// spaces
'binary_operator_spaces' => ['operators' => ['=>' => 'single_space', '=' => 'single_space']],
'array_indentation' => true,
'concat_space' => ['spacing' => 'one'],
'no_spaces_inside_parenthesis' => true,

// global
'blank_line_after_opening_tag' => true,
'blank_line_after_namespace' => true,
'braces' => [
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'next',
],
'constant_case' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
// 'encoding' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'header_comment' => ['comment_type' => 'comment', 'header' => $header, 'location' => 'after_open', 'separate' => 'bottom'],
// 'full_opening_tag' => true,
'heredoc_to_nowdoc' => true,
'lowercase_cast' => true,
'constant_case' => true,
'lowercase_keywords' => true,
'method_argument_space' => true,
'class_attributes_separation' => true,
'no_closing_tag' => true,
'no_leading_import_slash' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'single_blank_line_at_eof' => true,
'single_line_comment_style' => true,
'braces' => [
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'next'
]
])
->setFinder($finder);
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"php-cs-fixer.exclude": [],
"php-cs-fixer.executablePath": "${workspaceFolder}/bin/php-cs-fixer",
"php-cs-fixer.config": "${workspaceFolder}/.php_cs.dist",
"php-cs-fixer.config": ".php-cs-fixer.dist.php",
"php-cs-fixer.allowRisky": true,
"php-cs-fixer.lastDownload": 0,
"php-cs-fixer.showOutput": true,
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer",
"editor.formatOnSave": true
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"composer/package-versions-deprecated": "^1.11",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/orm": "^2.9",
"friendsofphp/php-cs-fixer": "^3.2",
"openpsa/universalfeedcreator": "^1.8",
"pclzip/pclzip": "^2.8",
"ramsey/uuid-doctrine": "^1.6",
Expand All @@ -41,7 +42,6 @@
"behat/mink-browserkit-driver": "^1.3",
"behat/symfony2-extension": "^2.1",
"dmore/behat-chrome-extension": "^1.3",
"friendsofphp/php-cs-fixer": "^2.16",
"phpspec/prophecy": "^1.11",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.42",
Expand Down
Loading

0 comments on commit 14d3ae0

Please sign in to comment.