From be57e0af86667cff42598e4f2ee313dae100e746 Mon Sep 17 00:00:00 2001 From: Simon Gaudreau Date: Tue, 12 Oct 2021 08:59:34 -0400 Subject: [PATCH] Use exolnet/phpcs-config for coding-style ruleset --- CONTRIBUTING.md | 2 +- composer.json | 5 +++-- ruleset.xml | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 ruleset.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43466c2..79cf3b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/eXolnet ## Pull Requests -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer lint`` and fix it with ``$ composer lint-fix``. +- **[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)** - Check the code style with ``$ composer lint`` and fix it with ``$ composer lint-fix``. - **Add tests!** - Your patch won't be accepted if it doesn't have tests. diff --git a/composer.json b/composer.json index 23ab69c..9a882c6 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "laravelcollective/html": "^6.0" }, "require-dev": { + "exolnet/phpcs-config": "^2.0", "mockery/mockery": "^1.4", "orchestra/testbench": "^4.0|^5.0|^6.0", "phpunit/phpunit": "^9.3.3", @@ -42,8 +43,8 @@ } }, "scripts": { - "lint": "vendor/bin/phpcs -p --standard=PSR2 src tests", - "lint-fix": "vendor/bin/phpcbf -p --standard=PSR2 src tests", + "lint": "vendor/bin/phpcs -p -s --standard=ruleset.xml", + "lint-fix": "vendor/bin/phpcbf -p --standard=ruleset.xml", "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 0000000..dbdf554 --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,7 @@ + + + src + tests + + +