From ff569d0ff476a8f8e08f566756789de5559a0d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Guti=C3=A9rrez?= Date: Sun, 8 Oct 2017 13:27:07 +0200 Subject: [PATCH] update tooling --- .travis.yml | 2 +- composer.json | 32 +++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d9cc16..3edb004 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_install: install: - if [[ "$TRAVIS_PHP_VERSION" != "5.6" ]]; then travis_retry composer require alcaeus/mongo-php-adapter $COMPOSER_GLOBAL_FLAGS --ignore-platform-reqs ; fi - travis_retry composer update $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress - - if [[ $TEST_VERSION == true ]]; then travis_retry composer require satooshi/php-coveralls:dev-master $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress ; fi + - if [[ $TEST_VERSION ]]; then travis_retry composer require php-coveralls/php-coveralls $COMPOSER_FLAGS --no-interaction --no-scripts --no-progress ; fi script: - if [[ $TEST_VERSION == true ]]; then composer qa & composer phpunit-clover ; fi diff --git a/composer.json b/composer.json index 1df15d1..d5f2b3f 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,12 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=5.6", + "php": "^5.6|^7.0", "slim/slim": "^3.0", "juliangut/doctrine-manager-builder": "^1.4" }, "require-dev": { + "brainmaestro/composer-git-hooks": "^2.1", "doctrine/orm": "^2.4", "doctrine/mongodb-odm": "^1.1", "doctrine/couchdb-odm": "dev-master", @@ -57,10 +58,14 @@ "bin": [ ], "config": { - "preferred-install": "dist" + "preferred-install": "dist", + "sort-packages": true }, "scripts": { - "phplint": "php -l src & php -l tests", + "cghooks": "cghooks", + "post-install-cmd": "cghooks add --ignore-lock", + "post-update-cmd": "cghooks update", + "php-lint": "php -l src && php -l tests", "phpcs": "phpcs --standard=PSR2 src tests", "phpcs-lint": "php-cs-fixer fix --dry-run --verbose", "phpcpd": "phpcpd src", @@ -68,9 +73,26 @@ "phpunit": "phpunit", "phpunit-coverage": "phpunit --coverage-html build/coverage", "phpunit-clover": "phpunit --coverage-clover build/logs/clover.xml", - "qa": "composer phplint & composer phpcs & composer phpcs-lint & composer phpcpd & composer phpmd", + "qa": [ + "@php-lint", + "@phpcs", + "@phpcs-lint", + "@phpcpd", + "@phpmd" + ], + "reports": [ + "@phpunit-coverage" + ], "fix": "php-cs-fixer fix --verbose", "security": "composer outdated", - "test": "composer qa & composer phpunit" + "test": [ + "@php-lint", + "@phpunit" + ] + }, + "extra": { + "hooks": { + "pre-commit": "composer qa && composer phpunit" + } } }