Skip to content

Commit

Permalink
Upgrade PHP-CS-Fixer to 3.x (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa authored Oct 5, 2021
1 parent e32022e commit 6482c05
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
22 changes: 11 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.editorconfig export-ignore
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
/.travis.yml export-ignore
/.php_cs.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
/.travis.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests/ export-ignore
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
run: composer update --no-interaction --no-progress

- name: Download PHP CS Fixer
run: composer require "friendsofphp/php-cs-fixer:2.18.4"
run: composer require "friendsofphp/php-cs-fixer:3.2.1"

- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
run: vendor/bin/php-cs-fixer fix --diff --dry-run

psalm:
name: Psalm
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ artifacts/
vendor/
composer.lock
phpunit.xml
.php_cs
.php_cs.cache
.php-cs-fixer.php
.php-cs-fixer.cache
.phpunit.result.cache
9 changes: 4 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<?php

$config = PhpCsFixer\Config::create()
$config = (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['operators' => ['=>' => null]],
'blank_line_after_opening_tag' => true,
'class_attributes_separation' => ['elements' => ['method']],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_strict_types' => false,
'dir_constant' => true,
'final_static_access' => true,
'fully_qualified_strict_types' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'header_comment' => false,
'is_null' => ['use_yoda_style' => false],
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'magic_method_casing' => true,
Expand Down Expand Up @@ -66,13 +64,14 @@
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_var_without_name' => true,
'return_assignment' => true,
'self_static_accessor' => true,
'short_scalar_cast' => true,
'single_trait_insert_per_statement' => true,
'standardize_not_equals' => true,
//'static_lambda' => true,
'ternary_to_null_coalescing' => true,
'trim_array_spaces' => true,
'visibility_required' => true,
'visibility_required' => ['elements' => ['property', 'method']],
'yoda_style' => false,
// 'native_function_invocation' => true,
'braces' => ['allow_single_line_closure'=>true],
Expand Down

0 comments on commit 6482c05

Please sign in to comment.