language: php

matrix:
  include:
    - php: 5.6
    - php: 5.6
      env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
    - php: 7.1
    - php: 7.1
      env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
    - php: 7.2
    - php: 7.2
      env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
      env: COVERAGE='--coverage-clover build/logs/clover.xml'
  fast_finish: true

sudo: false

before_script:
  - travis_wait composer update $COMPOSER_FLAGS --no-interaction

script:
  - if [[ $COVERAGE ]]; then mkdir -p build/logs; fi
  - php vendor/bin/phpunit $COVERAGE

after_script:
- if [[ $COVERAGE ]]; then php vendor/bin/php-coveralls; fi
