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..7140c60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,16 +3,34 @@ 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 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..f9c972b 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.1", + "phpro/grumphp": "^0.19 || ^1.2.0" } } 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 } /**