language: php
sudo: false
dist: trusty

php:
  - 5.6
  - 7.0
  - 7.1
  - hhvm

cache:
  directories:
  - vendor

before_install:
  - export XDEBUG="/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"
  - is_hhvm () { [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; }
  - is_hhvm || mv -v "$XDEBUG" "$XDEBUG.disabled"

install:
  - travis_retry composer update -a --no-interaction
  - travis_retry wget https://scrutinizer-ci.com/ocular.phar

before_script:
  - if is_hhvm; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini; fi

script:
  - is_hhvm || mv -v "$XDEBUG.disabled" "$XDEBUG"
  - vendor/bin/phpunit --coverage-clover=coverage.clover --coverage-text
  - is_hhvm || mv -v "$XDEBUG" "$XDEBUG.disabled"
  - vendor/bin/phpcs --standard=PSR2 src tests
  - vendor/bin/php-cs-fixer fix -v --dry-run --allow-risky=yes --using-cache=no

after_script:
  - is_hhvm || php ocular.phar code-coverage:upload --format=php-clover coverage.clover

language: php
sudo: false
dist: trusty

php:
  - 5.6
  - 7.0
  - 7.1
  - hhvm

cache:
  directories:
    - vendor

before_install:
  - export XDEBUG="/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"
  - is_hhvm () { [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; }
  - is_hhvm || mv -v "$XDEBUG" "$XDEBUG.disabled"

install:
  - travis_retry composer update -a --no-interaction
  - travis_retry wget https://scrutinizer-ci.com/ocular.phar

script:
  - vendor/bin/phpcs --standard=PSR2 src tests
  - vendor/bin/php-cs-fixer fix -v --dry-run --allow-risky=yes --using-cache=no
  - if is_hhvm; then echo "xdebug.enable = On" >> /etc/hhvm/php.ini; else mv -v "$XDEBUG.disabled" "$XDEBUG"; fi
  - vendor/bin/phpunit --coverage-clover=coverage.clover --coverage-text

after_script:
  - is_hhvm || php ocular.phar code-coverage:upload --format=php-clover coverage.clover

Use more elegant xdebug toggling
Use more elegant xdebug toggling
