diff --git a/.gitignore b/.gitignore index 16188c4..42b7338 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .idea composer.lock coverage +.php_cs.cache diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..2f41a5d --- /dev/null +++ b/.php_cs @@ -0,0 +1,16 @@ +exclude([ + 'vendor', + ]) + ->in(__DIR__) + ->files()->name('*.php') +; + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + ]) + ->setFinder($finder) +; diff --git a/composer.json b/composer.json index 3dda8f9..032569a 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,7 @@ "post-install-cmd": [ "test -d .git && cp contrib/pre-commit .git/hooks/pre-commit", "test -d .git && chmod +x .git/hooks/pre-commit" - ] + ], + "cs": "php-cs-fixer fix --config=.php_cs" } }