From e77425c7386e4933a7f11cf70753af11b2ee7dcc Mon Sep 17 00:00:00 2001 From: Yoichi Fujimoto Date: Wed, 30 Apr 2025 08:55:39 +0900 Subject: [PATCH] chore: add PHP CS Fixer configuration and update composer scripts --- .php-cs-fixer.php | 15 +++++++++++++++ composer.json | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .php-cs-fixer.php diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..d62e880 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,15 @@ +in([ + __DIR__ . '/lib', + __DIR__ . '/tests', + ]) + ->append([ + __FILE__, + __DIR__ . '/init.php', + __DIR__ . '/build.php', + ]); + +$config = new PhpCsFixer\Config(); +return $config; diff --git a/composer.json b/composer.json index de7fb3f..0ecf336 100755 --- a/composer.json +++ b/composer.json @@ -33,9 +33,10 @@ } }, "scripts": { - "test": [ - "phpcs --standard=PSR2 -n lib tests *.php", - "phpunit" - ] + "format": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --config=.php-cs-fixer.php lib tests *.php", + "test": [ + "phpcs --standard=PSR2 -n lib tests *.php", + "phpunit" + ] } }