Skip to content

Commit

Permalink
Allow older CS fixer version for PHP versions below 7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekhyt committed Feb 23, 2024
1 parent 2e6415c commit 5a5955a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/.idea
/vendor
/.php-cs.cache
/.php_cs.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/temp/cache
/temp/logs

Expand Down
30 changes: 30 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

// For more information visit the Github repository: https://github.com/FriendsOfPHP/PHP-CS-Fixer

// How to set up PHP-CS-Fixer in PHPStorm:
// https://hackernoon.com/how-to-configure-phpstorm-to-use-php-cs-fixer-1844991e521f

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$fixers = array(
'@PSR1' => 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__)
);
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 5a5955a

Please sign in to comment.