From 72adbc74e91684336497021d3f03302c25688ea1 Mon Sep 17 00:00:00 2001 From: meyerbaptiste Date: Mon, 6 Sep 2021 15:19:40 +0200 Subject: [PATCH] Upgrade PHP-CS-Fixer to v3 --- .gitignore | 3 ++- .php_cs => .php-cs-fixer.dist.php | 6 ++---- CONTRIBUTING.md | 12 ++++++------ Makefile | 2 +- resources/checkstyle.json | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) rename .php_cs => .php-cs-fixer.dist.php (88%) diff --git a/.gitignore b/.gitignore index 3500b597..3c710c1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /composer.lock /.deptrac.cache /.phpunit.result.cache -/.php_cs.cache +/.php-cs-fixer.php +/.php-cs-fixer.cache /build/ /vendor/ diff --git a/.php_cs b/.php-cs-fixer.dist.php similarity index 88% rename from .php_cs rename to .php-cs-fixer.dist.php index 82afe319..c4ff577a 100644 --- a/.php_cs +++ b/.php-cs-fixer.dist.php @@ -4,19 +4,18 @@ ->in(['src', 'tests']) ; -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], 'blank_line_before_statement' => true, 'concat_space' => ['spacing' => 'none'], 'declare_strict_types' => true, - 'native_function_invocation' => true, + 'native_function_invocation' => ['include' => ['@internal']], 'no_empty_comment' => true, 'no_empty_phpdoc' => true, 'no_empty_statement' => true, 'no_extra_blank_lines' => true, - 'no_extra_consecutive_blank_lines' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, 'no_unused_imports' => true, @@ -32,4 +31,3 @@ ]) ->setFinder($finder) ; - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b778cb02..cb650f41 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,13 +60,13 @@ Downloads a phar for the given alias using phive and puts it into the specified ```json { - "command": { - "phive-install": { - "alias": "dephpend", - "bin": "%target-dir%/dephpend", - "sig": "76835C9464877BDD" - } + "command": { + "phive-install": { + "alias": "dephpend", + "bin": "%target-dir%/dephpend", + "sig": "76835C9464877BDD" } + } } ``` diff --git a/Makefile b/Makefile index 585ae00c..0c79fb64 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ tools/phpunit: vendor/bin/phpunit ln -sf ../vendor/bin/phpunit tools/phpunit tools/php-cs-fixer: - curl -Ls http://cs.symfony.com/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer + curl -Ls http://cs.symfony.com/download/php-cs-fixer-v3.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer tools/deptrac: curl -Ls https://github.com/qossmic/deptrac/releases/download/0.13.0/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac diff --git a/resources/checkstyle.json b/resources/checkstyle.json index aa8635af..69bdc603 100644 --- a/resources/checkstyle.json +++ b/resources/checkstyle.json @@ -20,7 +20,7 @@ "website": "http://cs.symfony.com/", "command": { "phive-install": { - "alias": "php-cs-fixer@^2.0", + "alias": "php-cs-fixer@^3.0", "bin": "%target-dir%/php-cs-fixer", "sig": "E82B2FB314E9906E" }