language: php

env:
  - COMPOSER_OPTS=""
  - COMPOSER_OPTS="--prefer-lowest"

php:
  - 7.2
  - 7.4

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

before_install:
  - travis_retry composer self-update

install:
  - travis_retry composer update --no-interaction --prefer-source

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

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
