From 149d9d35b084ce434b7993c308d15f30a05c6512 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Fri, 11 Aug 2023 16:21:16 +0200 Subject: [PATCH] feat: allow php-cs-fixer v3 --- .gitignore | 2 +- .php_cs | 27 --------------------------- composer.json | 2 +- php-cs-fixer.dist.php | 16 ++++++++++++++++ 4 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 .php_cs create mode 100644 php-cs-fixer.dist.php diff --git a/.gitignore b/.gitignore index 2c98ebac..ead77b1f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ /.env # PHP CS Fixer -/.php_cs.cache +/.php-cs-fixer.cache # PHPUnit /build diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 78909329..00000000 --- a/.php_cs +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please read the LICENSE - * file that was distributed with this source code. - */ - -use PhpCsFixer\Config; -use PhpCsFixer\Finder; - -$finder = Finder::create() - ->in(__DIR__) - ->exclude('vendor'); - -return Config::create() - ->setUsingCache(true) - ->setRules([ - '@Symfony' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => true, - 'yoda_style' => false, - ]) - ->setFinder($finder); diff --git a/composer.json b/composer.json index 3e37a512..89c2c3e7 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "sebastian/exporter": "<2.0.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", + "friendsofphp/php-cs-fixer": "^2.19 || ^3.22", "matthiasnoback/symfony-dependency-injection-test": "^3.0 || ^4.0", "symfony/console": "^4.4 || ^5.0 || ^6.0", "symfony/phpunit-bridge": "^4.4 || ^5.0 || ^6.0", diff --git a/php-cs-fixer.dist.php b/php-cs-fixer.dist.php new file mode 100644 index 00000000..4b24c291 --- /dev/null +++ b/php-cs-fixer.dist.php @@ -0,0 +1,16 @@ +notPath('vendor') + ->in(__DIR__) +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + 'array_syntax' => ['syntax' => 'short'], + 'yoda_style' => false, + 'no_superfluous_phpdoc_tags' => false, + ]) + ->setFinder($finder) +;