diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4527b1..126fc7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/:vendor ## Pull Requests -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). +- **[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 check-style`` and fix it with ``$ composer fix-style``. - **Add tests!** - Your patch won't be accepted if it doesn't have tests. diff --git a/composer.json b/composer.json index 8a9255b..098b0b1 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require-dev": { "phpunit/phpunit" : "~4.0||~5.0", "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.3" + "squizlabs/php_codesniffer": "^2.3" }, "autoload": { "psr-4": { @@ -36,7 +36,8 @@ }, "scripts": { "test": "phpunit", - "format": "phpcbf --standard=psr2 src/" + "check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests", + "fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests" }, "extra": { "branch-alias": {