From 371773e5a5b58890c98303f66544a8772bbeec90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Tue, 19 May 2015 20:05:24 +0200 Subject: [PATCH 1/6] Add PHP Codesniffer as development dependency --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8a9255b..3a21dcb 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": { From a243b4a03ad89e2c43942f286763da3a3630f66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Tue, 19 May 2015 20:06:21 +0200 Subject: [PATCH 2/6] Add Composer scripts "check-codestyle" & "fix-codestyle" --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3a21dcb..2641bed 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,8 @@ }, "scripts": { "test": "phpunit", - "format": "phpcbf --standard=psr2 src/" + "check-codestyle": "phpcs -p --standard=PSR2 src tests", + "fix-codestyle": "phpcbf -p --standard=PSR2 src tests" }, "extra": { "branch-alias": { From 4b35187e4b3bf1152e2491f178eb7f2dc47579a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Tue, 19 May 2015 20:13:08 +0200 Subject: [PATCH 3/6] Adjust Contribution guide --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4527b1..864d316 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-codestyle`` and fix it with ``$ composer fix-codestyle``. - **Add tests!** - Your patch won't be accepted if it doesn't have tests. From 861d69077f02b5392b465b3543078bce54758fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Thu, 21 May 2015 01:55:46 +0200 Subject: [PATCH 4/6] Ignore errors and warnings in PHPCS Refs: https://github.com/thephpleague/skeleton/pull/41#issuecomment-104071697 Thanks to @gsherwood --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2641bed..154290a 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,8 @@ }, "scripts": { "test": "phpunit", - "check-codestyle": "phpcs -p --standard=PSR2 src tests", - "fix-codestyle": "phpcbf -p --standard=PSR2 src tests" + "check-codestyle": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests", + "fix-codestyle": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests" }, "extra": { "branch-alias": { From 8e47aefcd82e1821e7f0563bbed3b0b9498fd1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Wed, 14 Sep 2016 17:14:21 +0200 Subject: [PATCH 5/6] Fix indentation --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 154290a..ff1246a 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": { From fcb1285761984c42fa4eb9e75a2e6ec7ae80713f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Wed, 14 Sep 2016 17:22:46 +0200 Subject: [PATCH 6/6] Replace check-codestyle & fix-codestyle with check-style & fix-style respecively --- CONTRIBUTING.md | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 864d316..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)** - Check the code style with ``$ composer check-codestyle`` and fix it with ``$ composer fix-codestyle``. +- **[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 ff1246a..098b0b1 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,8 @@ }, "scripts": { "test": "phpunit", - "check-codestyle": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests", - "fix-codestyle": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests" + "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": {