From 5a5955ab8632911be54b12d8bf117323f52f40fc Mon Sep 17 00:00:00 2001 From: Timo Ebel Date: Fri, 23 Feb 2024 11:59:09 +0100 Subject: [PATCH] Allow older CS fixer version for PHP versions below 7.4. --- .gitignore | 2 ++ .php_cs.dist | 30 ++++++++++++++++++++++++++++++ composer.json | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .php_cs.dist diff --git a/.gitignore b/.gitignore index 7d725da..a89c7ba 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,9 @@ /.idea /vendor /.php-cs.cache +/.php_cs.cache /.php-cs-fixer.cache +/.phpunit.result.cache /temp/cache /temp/logs diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..90560fa --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,30 @@ + true, + '@PSR2' => true, + 'array_syntax' => array( + 'syntax' => 'long', + ), + 'blank_line_after_opening_tag' => true, + 'method_argument_space' => false, +); + +return Config::create() + ->setRiskyAllowed(true) + ->setUsingCache(true) + ->setRules($fixers) + ->setFinder( + Finder::create() + ->exclude('vendor') + ->exclude('vendors') + ->in(__DIR__) + ); diff --git a/composer.json b/composer.json index cb6eeaf..387e9f9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "ext-json": "*", - "friendsofphp/php-cs-fixer": "^v3.49.0", + "friendsofphp/php-cs-fixer": "^2.19.3 ||3.49.0", "phpunit/phpunit": ">= 5", "yoast/phpunit-polyfills": "^1.0" },