language: php

php:
  - 7.0
  - 7.1
  - 7.2

cache:
  directories:
    - $HOME/.composer/cache

env:
  matrix:
    - COMPOSER_FLAGS="--prefer-lowest"
    - COMPOSER_FLAGS=""

before_script:
  - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist

script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - if [[ $COMPOSER_FLAGS == '' ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

matrix:
  allow_failures:
  - php: 7.2

language: php

php:
  - 7.0
  - 7.1
  - 7.2

cache:
  directories:
    - $HOME/.composer/cache

before_script:
  - travis_retry composer update --no-interaction --prefer-dist

script:
  - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - if [ $(phpenv version-name) == "7.1" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

matrix:
  allow_failures:
  - php: 7.2

Remove lower dependencies runs. Only run coverage for php 7.1
Remove lower dependencies runs. Only run coverage for php 7.1
