language: php

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

sudo: false

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

env:
  - SYMFONY_VERSION=2.7.*

matrix:
  fast_finish: true
  include:
    - php: 5.6
      env: SYMFONY_VERSION=2.3.*
    - php: 5.6
      env: SYMFONY_VERSION=2.8.*
    - php: 5.6
      env: SYMFONY_VERSION=3.0.*
    - php: 5.6
      env: SYMFONY_VERSION=3.1.*
    - php: 5.6
      env: SYMFONY_VERSION=3.2.*
    - php: 5.6
      env: SYMFONY_VERSION=@dev
    - php: 7.0
      env: TWIG_VERSION=2.x
    - php: 5.3
      env: COMPOSER_FLAGS="--prefer-lowest"
  allow_failures:
    - php: 5.6
      env: SYMFONY_VERSION=@dev

before_install:
  - if [[ ${TRAVIS_PHP_VERSION} != "hhvm" ]]; then phpenv config-add travis.php.ini; fi;
  - composer self-update
  - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
  - if [ "$TWIG_VERSION" != "" ]; then composer require twig/twig:$TWIG_VERSION --no-update; fi

install: composer update --prefer-source $COMPOSER_FLAGS

script: ./vendor/bin/phpunit --coverage-text

notifications:
  slack: liip:3QOs1QKt3aCFxpJvRzpJCbVZ
