Skip to content

Commit

Permalink
Update PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 4, 2021
1 parent a3ded77 commit 5d3b76a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
28 changes: 14 additions & 14 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/.docker export-ignore
/.github export-ignore
/.phive export-ignore
/.psalm export-ignore
/build export-ignore
/tools export-ignore
/tools/* binary
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/build.xml export-ignore
/phpunit.xml export-ignore
/.docker export-ignore
/.github export-ignore
/.phive export-ignore
/.psalm export-ignore
/build export-ignore
/tools export-ignore
/tools/* binary
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/build.xml export-ignore
/phpunit.xml export-ignore

*.php diff=php
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/build/tmp

# PHP-CS-Fixer
/.php_cs
/.php_cs.cache
/.php-cs-fixer.php
/.php-cs-fixer.cache

# Psalm
/.psalm/cache
Expand Down
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="^1.25" installed="1.26.0" location="./tools/phpab" copy="true"/>
<phar name="php-cs-fixer" version="^2.16" installed="2.18.6" location="./tools/php-cs-fixer" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.0.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="phpdox" version="^0.12" installed="0.12.0" location="./tools/phpdox" copy="true"/>
<phar name="phploc" version="^4.0" installed="4.0.1" location="./tools/phploc" copy="true"/>
<phar name="psalm" version="^4.0" installed="4.7.1" location="./tools/psalm" copy="true"/>
Expand Down
21 changes: 16 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
->notName('ValueObjectWithEqualsMethodWithUnionReturnType.php')
->notName('ValueObjectWithEqualsMethodThatHasUnionParameterType.php');

return PhpCsFixer\Config::create()
->setFinder($finder)
$config = new PhpCsFixer\Config;
$config->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'align_multiline_comment' => true,
Expand All @@ -45,7 +45,6 @@
'continue',
'declare',
'default',
'die',
'do',
'exit',
'for',
Expand All @@ -66,7 +65,13 @@
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one'
]
],
'class_definition' => true,
'clean_namespace' => true,
'combine_consecutive_issets' => true,
Expand Down Expand Up @@ -280,7 +285,11 @@
'ternary_operator_spaces' => true,
'ternary_to_elvis_operator' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => [
'elements' => [
'arrays'
]
],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
Expand All @@ -293,3 +302,5 @@
'void_return' => true,
'whitespace_after_comma_in_array' => true,
]);

return $config;
Binary file modified tools/php-cs-fixer
Binary file not shown.

1 comment on commit 5d3b76a

@keradus
Copy link
Contributor

@keradus keradus commented on 5d3b76a May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻 ❤️

Please sign in to comment.