language: php

sudo: false

dist: trusty

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

matrix:
  include:
    - php: 5.5
    - php: 5.5
      env: setup=lowest
    - php: 5.6
    - php: 7.0
    - php: 7.0
      env: setup=lowest
    - php: 7.1
    - php: 7.2
    - php: 7.3
    - php: 7.4snapshot

env:
  global:
    - setup=basic

install:
  - if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction; fi
  - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi

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

after_success:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
