From 649ea2f4aa87857d9fa216b22d367aacf2064785 Mon Sep 17 00:00:00 2001 From: Yannick ROGER Date: Wed, 30 Dec 2020 17:14:34 +0100 Subject: [PATCH] chore(CS): Added php-cs config --- .gitignore | 1 + .php_cs | 16 ++++++++++++++++ composer.json | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .php_cs 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" } }