language: php

php:
  - 5.6
  - 7.0
  - 7.1
  - 7.2

sudo: false

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

env:
    global:
        - COMPOSER_PREFER_LOWEST=false
        - SYMFONY_DEPRECATIONS_HELPER=weak
        - SYMFONY_PHPUNIT_BRIDGE_VERSION=2.8.*
        - SYMFONY_VERSION=2.8.*
matrix:
    include:
        - php: 5.6
          env: SYMFONY_VERSION=2.8.* SYMFONY_PHPUNIT_BRIDGE_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 5.6
          env: SYMFONY_VERSION=3.0.* SYMFONY_PHPUNIT_BRIDGE_VERSION=3.0.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 5.6
          env: SYMFONY_VERSION=3.1.* SYMFONY_PHPUNIT_BRIDGE_VERSION=3.1.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 5.6
          env: SYMFONY_VERSION=3.2.* SYMFONY_PHPUNIT_BRIDGE_VERSION=3.2.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 5.6
          env: SYMFONY_VERSION=3.3.* SYMFONY_PHPUNIT_BRIDGE_VERSION=3.3.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 7.1
          env: SYMFONY_VERSION=3.4.* SYMFONY_PHPUNIT_BRIDGE_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 7.1
          env: SYMFONY_VERSION=4.0.* SYMFONY_PHPUNIT_BRIDGE_VERSION=4.0.* SYMFONY_DEPRECATIONS_HELPER=strict
        - php: 7.2
          env: SYMFONY_VERSION=4.0.* SYMFONY_PHPUNIT_BRIDGE_VERSION=4.0.* SYMFONY_DEPRECATIONS_HELPER=strict
install:
  - composer self-update
  - if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
  - composer require --no-update symfony/symfony:${SYMFONY_VERSION}
  - composer require --no-update symfony/form:${SYMFONY_VERSION}  
  - composer require --dev --no-update symfony/phpunit-bridge:${SYMFONY_PHPUNIT_BRIDGE_VERSION}
  - if [[ "$SYMFONY_VERSION" = *dev* ]]; then sed -i "s/\"MIT\"/\"MIT\",\"minimum-stability\":\"dev\"/g" composer.json; fi
  - composer update --prefer-source `if [[ $COMPOSER_PREFER_LOWEST = true ]]; then echo "--prefer-lowest --prefer-stable"; fi`

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

after_script:
  - php vendor/bin/coveralls -v

notifications:
  email: helios.ag@gmail.com
