language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - nightly
  - hhvm
  - hhvm-nightly

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

matrix:
  fast_finish: true
  include:
    - php: 5.3
      env: deps="low"
    - php: 5.5
      env: SYMFONY_VERSION='2.3.* symfony/expression-language:2.4.*'
    - php: 5.5
      env: SYMFONY_VERSION='2.3.* sensio/framework-extra-bundle:2.*'
    - php: 5.5
      env: SYMFONY_VERSION=2.4.*
    - php: 5.5
      env: SYMFONY_VERSION=2.6.*
    - php: 5.5
      env: SYMFONY_VERSION='2.7.*'
    - php: 5.5
      env: SYMFONY_VERSION='2.8.*@dev'
  allow_failures:
    - php: nightly
    - php: hhvm-nightly

before_script:
  - composer self-update
  - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi
  - if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi
  - if [ "$deps" != "low" ]; then composer update --prefer-source; fi

script: phpunit --coverage-clover=coverage.clover

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