From 98692f5db8ee3ece7c6fed12b3d18280b21cb8e9 Mon Sep 17 00:00:00 2001 From: Nattfarinn Date: Tue, 17 May 2022 11:18:11 +0200 Subject: [PATCH] Added modern ibexa PHP-CS fixer configuration --- .php-cs-fixer.php | 27 +++++++++++++++++++++++++++ .php_cs | 14 -------------- composer.json | 7 +++++-- 3 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 .php-cs-fixer.php delete mode 100644 .php_cs diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000000..38b8df8e41 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,27 @@ +withRules([ + 'header_comment' => false, +]); + +return $configFactory + ->buildConfig() + ->setFinder( + PhpCsFixer\Finder::create() + ->in( + array_filter([ + __DIR__ . '/code_samples', + __DIR__ . '/tests', + ], 'is_dir') + ) + ->files()->name('*.php') + ); diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 6e09b5df18..0000000000 --- a/.php_cs +++ /dev/null @@ -1,14 +0,0 @@ -setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__ . '/tests') - ->files()->name('*.php') - ) -; diff --git a/composer.json b/composer.json index 6c2aee8746..75179f752e 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,10 @@ "symfony/property-access": "^5.0" }, "require-dev": { - "ezsystems/ezplatform-code-style": "^0.1.0", - "friendsofphp/php-cs-fixer": "^2.16.0" + "ibexa/code-style": "^1.0" + }, + "scripts": { + "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", + "check-cs": "@fix-cs --dry-run" } }