language: php

git:
  depth: 1

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

sudo: false

env:
  global:
    - COMPOSER_ALLOW_XDEBUG=0
    - SYMFONY_DEPRECATIONS_HELPER=weak

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

before_install:
  - composer selfupdate

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/coveralls; fi
