From 2027ef4144d1583259f6531c5f0dba59709053f8 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Sun, 13 Nov 2016 16:12:31 +0100 Subject: [PATCH 1/4] Remove CS dependencies and add zend-coding-standard to require-dev --- composer.json | 2 +- composer.lock | 43 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index e442430..0b2a949 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require-dev": { "phpunit/PHPUnit": "^4.8", - "squizlabs/php_codesniffer": "^2.3.1" + "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "zendframework/zend-cache": "To support Zend\\XmlRpc\\Server\\Cache usage" diff --git a/composer.lock b/composer.lock index cd2c80a..b2c06fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1b00932f5705a7882de159ba9cd663da", - "content-hash": "174a9300d7dee27c07ae28fdbef76805", + "hash": "604d7acb6122639d3ccece8fc812a5e4", + "content-hash": "9b38bb6d63ea7d59c3c03045f233084d", "packages": [ { "name": "container-interop/container-interop", @@ -1640,16 +1640,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.6.1", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d" + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", "shasum": "" }, "require": { @@ -1714,7 +1714,7 @@ "phpcs", "standards" ], - "time": "2016-05-30 22:24:32" + "time": "2016-09-01 23:53:02" }, { "name": "symfony/yaml", @@ -1813,6 +1813,35 @@ "validate" ], "time": "2015-08-24 13:29:44" + }, + { + "name": "zendframework/zend-coding-standard", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-coding-standard.git", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-coding-standard/zipball/893316d2904e93f1c74c1384b6d7d57778299cb6", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework coding standard", + "keywords": [ + "Coding Standard", + "zf" + ], + "time": "2016-11-09 21:30:43" } ], "aliases": [], From c209841154a44329ae1c5206600417c9547aebcc Mon Sep 17 00:00:00 2001 From: Koopzington Date: Sun, 13 Nov 2016 20:06:59 +0100 Subject: [PATCH 2/4] add/update phpcs.xml --- phpcs.xml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 3a75381..c48d19c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,23 +1,8 @@ - Zend Framework coding standard - - - - - - - - - - - - - + src test - test/_files/* - test/TestAsset/* From e8dedb882cd22c5a3d988e2b686d9b4c8fbbdf76 Mon Sep 17 00:00:00 2001 From: Koopzington Date: Sun, 13 Nov 2016 20:41:37 +0100 Subject: [PATCH 3/4] Use composer scripts in .travis.yml --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc63361..37a20e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,8 +75,7 @@ install: - composer show script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; fi - - if [[ $TEST_COVERAGE != 'true' ]]; then composer test ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi From 0a85a72b9050d85fc8b0e57f9478862b74ab8ebd Mon Sep 17 00:00:00 2001 From: Koopzington Date: Sun, 13 Nov 2016 20:43:22 +0100 Subject: [PATCH 4/4] Replace mentions of php-cs-fixer with phpcs --- CONTRIBUTING.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9401e3..8e8c492 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,24 +77,24 @@ To do so: ## Running Coding Standards Checks -This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding +This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding standards checks, and provides configuration for our selected checks. -`php-cs-fixer` is installed by default via Composer. +`phpcs` is installed by default via Composer. To run checks only: ```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs +$ ./vendor/bin/phpcs ``` -To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run` -flag: +`phpcs` also includes a tool for fixing most CS violations, `phpcbf`: + ```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs +$ ./vendor/bin/phpcbf ``` -If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure +If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure they pass, and make sure you add and commit the changes after verification. ## Recommended Workflow for Contributions