Skip to content

Commit

Permalink
Upgrade PHP-CS-Fixer to 3.x (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa committed Oct 6, 2021
1 parent c7b89ff commit c793ad3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
.php_cs.dist export-ignore
.php-cs-fixer.dist.php export-ignore
/Makefile export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: composer bin php-cs-fixer update --no-interaction --no-progress

- 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
@@ -1,5 +1,5 @@
.php_cs
.php_cs.cache
.php-cs-fixer.php
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
vendor/
Expand Down
8 changes: 4 additions & 4 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php

$config = PhpCsFixer\Config::create()
$config = (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'final_static_access' => true,
'fully_qualified_strict_types' => true,
'function_to_constant' => ['functions' => ['php_sapi_name']],
'header_comment' => false,
'is_null' => ['use_yoda_style' => true],
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'magic_method_casing' => true,
Expand All @@ -36,11 +34,11 @@
'php_unit_mock' => ['target' => 'newest'],
'php_unit_mock_short_will_return' => true,
'php_unit_no_expectation_annotation' => ['target' => 'newest'],
'php_unit_ordered_covers' => true,
'php_unit_test_annotation' => ['style' => 'prefix'],
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order_by_value' => ['annotations' => ['covers']],
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
Expand All @@ -49,11 +47,13 @@
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_var_without_name' => true,
'self_static_accessor' => true,
'single_trait_insert_per_statement' => true,
'standardize_not_equals' => true,
'ternary_to_null_coalescing' => true,
'visibility_required' => true,
'void_return' => true,
'yoda_style' => false,
// 'native_function_invocation' => true,
])
->setFinder(
Expand Down
2 changes: 1 addition & 1 deletion tests/UriResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class UriResolverTest extends TestCase
{
const RFC3986_BASE = 'http://a/b/c/d;p?q';
private const RFC3986_BASE = 'http://a/b/c/d;p?q';

/**
* @dataProvider getResolveTestCases
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"friendsofphp/php-cs-fixer": "2.18.4"
"friendsofphp/php-cs-fixer": "3.2.1"
},
"config": {
"preferred-install": "dist"
Expand Down

0 comments on commit c793ad3

Please sign in to comment.