From 91dbe6bcdcd15e1b1705c8d75039f9dc67c52aa1 Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Fri, 11 Dec 2020 14:52:58 +0100 Subject: [PATCH 1/3] Update all deps and config --- .github/codecov.yml | 21 +++++++++++++++++++++ .travis.yml | 25 ++++++++++++++++++++++--- composer.json | 12 ++++++------ 3 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..caf3c68 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,21 @@ +codecov: + require_ci_to_pass: yes + ci: + - "travis.org" +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,files,footer" + behavior: default + require_changes: no diff --git a/.travis.yml b/.travis.yml index b148747..819fbf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,16 +3,35 @@ php: - '7.2' - '7.3' - '7.4' + - '8.0' + +cache: + directories: + - $HOME/.composer/cache/files + +matrix: + fast_finish: true + include: + - php: 7.2 + env: COMPOSER_FLAGS="--prefer-lowest" before_script: - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-source --dev + - travis_retry composer update $COMPOSER_FLAGS --no-interaction --prefer-dist --dev + - phpenv config-rm xdebug.ini + - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then + pecl install xdebug-2.9.8; + echo "zend_extension=xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; + echo "XDEBUG_MODE=coverage" > xdebug.ini; + phpenv config-add xdebug.ini; + fi script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - ./vendor/bin/phpmd src text ./ruleset.xml - ./vendor/bin/phpcs - ./vendor/bin/psalm + - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then ./vendor/bin/phpunit --coverage-clover coverage.xml; else ./vendor/bin/phpunit; fi + - ls -la after_success: - - bash <(curl -s https://codecov.io/bash) + - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/composer.json b/composer.json index 678a764..1c4efd0 100644 --- a/composer.json +++ b/composer.json @@ -20,16 +20,16 @@ } }, "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "psr/event-dispatcher": "^1.0", "psr/container": "^1.0", - "jeckel-lab/contract": ">=0.1.2" + "jeckel-lab/contract": ">=1.1.1" }, "require-dev": { - "phpunit/phpunit": "^8.4", - "phpmd/phpmd": "^2.7", + "phpunit/phpunit": "^8.5 || ^9.5", + "phpmd/phpmd": "^2.9", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^3.8 || ^4.0", - "phpro/grumphp": "^0.19.0" + "vimeo/psalm": "^4.3", + "phpro/grumphp": "^0.19 || ^1.2.0" } } From 83c2b7aa69ef7287d6cdcab973a1113ccafff44c Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Fri, 11 Dec 2020 15:01:29 +0100 Subject: [PATCH 2/3] Fix bug free psalm version --- .travis.yml | 1 - composer.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 819fbf7..7140c60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ script: - ./vendor/bin/phpcs - ./vendor/bin/psalm - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then ./vendor/bin/phpunit --coverage-clover coverage.xml; else ./vendor/bin/phpunit; fi - - ls -la after_success: - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/composer.json b/composer.json index 1c4efd0..f9c972b 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "phpunit/phpunit": "^8.5 || ^9.5", "phpmd/phpmd": "^2.9", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.3", + "vimeo/psalm": "^4.3.1", "phpro/grumphp": "^0.19 || ^1.2.0" } } From 8d429dbad533b18c7ba3368503d262d0facdefa4 Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Fri, 11 Dec 2020 15:29:31 +0100 Subject: [PATCH 3/3] Upgrade coverage --- src/Resolver/CommandHandlerResolver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resolver/CommandHandlerResolver.php b/src/Resolver/CommandHandlerResolver.php index 7af2174..09d2d77 100644 --- a/src/Resolver/CommandHandlerResolver.php +++ b/src/Resolver/CommandHandlerResolver.php @@ -54,12 +54,13 @@ public function resolve(Command $command): CommandHandler assert($instance instanceof CommandHandler, 'Handler should be an instance of CommandHandler'); return $instance; } - + // @codeCoverageIgnoreStart throw new HandlerNotFoundException(sprintf( 'No command handler instance for %s found in container for %s', $handler, get_class($command) )); + // @codeCoverageIgnoreEnd } /**