language: php

php:
  - 5.5
  - 5.6
  - 7.0
  - hhvm

branches:
    only:
        - master
        - /^\d+\.\d+$/

sudo: false

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

matrix:
    fast_finish: true
    include:
        - php: 5.3
          env: SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 5.3
          env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 5.4
          env: SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.0
          env: SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.0
          env: SYMFONY_VERSION=2.8.* COVERAGE=true SYMFONY_DEPRECATIONS_HELPER=weak
        - php: 7.0
          env: SYMFONY_VERSION=3.0.*

before_script:
    - if [ "$COVERAGE" != "true" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
    - composer self-update
    - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi
    - composer update $COMPOSER_FLAGS --prefer-source

script: if [ "$COVERAGE" == "true" ]; then phpunit --coverage-clover=clover; else phpunit; fi

after_success:
    - if [ "$COVERAGE" == "true" ]; then curl -sL https://bit.ly/artifact-uploader | php; fi
