sudo: false

language: php

php:
  - 5.5
  - 5.6
  - 7.0
  - hhvm

before_script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then composer require satooshi/php-coveralls:dev-master squizlabs/php_codesniffer:2.* -n ; fi
  - if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then composer install -n ; fi

script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then mkdir -p build/logs && phpunit --coverage-clover build/logs/clover.xml ; fi
  - if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then phpunit ; fi
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then vendor/bin/phpcs --standard=PSR2 --ignore=vendor/* -n -p . ; fi

after_script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then php vendor/bin/coveralls -v ; fi
