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