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" } }