dist: trusty

language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4

sudo: false

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

install:
  - travis_retry composer install --no-interaction --prefer-dist

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

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

after_script:
  - if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi
