language: php

php:
  - 5.5
  - 5.6
  - 7.0
  - hhvm

install:
  - composer install

before_script:
  - if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then PHPUNIT_FLAGS="--coverage-clover coverage.xml"; fi
  - if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer; fi

script:
  - phpunit $PHPUNIT_FLAGS
  - if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then php php-cs-fixer fix . --diff --dry-run -v --rules=@Symfony; fi

after_script:
  - if [[ $TRAVIS_PHP_VERSION = '5.6' ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi
