sudo: false

language: php

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

env:
  global:
    - TEST_COMMAND="./vendor/bin/phpunit"

matrix:
  fast_finish: true
  include:
    - php: 5.5
    - php: 5.6
      env:
        - EXECUTE_CS_CHECK=true
    - php: 7
      env:
        - EXECUTE_COVERAGE=true
        - TEST_COMMAND="./vendor/bin/phpunit --coverage-clover coverage.clover"
    - php: hhvm

notifications:
  email: true

install:
  - travis_retry composer install --no-interaction --prefer-dist

script:
  - $TEST_COMMAND
  - if [[ "$EXECUTE_CS_CHECK" == "true" ]]; then ./vendor/bin/phpcs ; fi

after_success:
  - if [[ "$EXECUTE_COVERAGE" == "true" ]]; then wget https://scrutinizer-ci.com/ocular.phar ; fi
  - if [[ "$EXECUTE_COVERAGE" == "true" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover ; fi

sudo: false

language: php

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

env:
  global:
    - TEST_COMMAND="./vendor/bin/phpunit"

matrix:
  fast_finish: true
  include:
    - php: 5.5
    - php: 5.6
      env:
        - EXECUTE_CS_CHECK=true
    - php: 7
      env:
        - EXECUTE_COVERAGE=true
        - TEST_COMMAND="./vendor/bin/phpunit --coverage-clover coverage.clover"
    - php: hhvm

notifications:
  email: true

before_install:
  - if [[ "$EXECUTE_COVERAGE" != "true" ]]; then phpenv config-rm xdebug.ini; fi

install:
  - travis_retry composer install --no-interaction --prefer-dist

script:
  - $TEST_COMMAND
  - if [[ "$EXECUTE_CS_CHECK" == "true" ]]; then ./vendor/bin/phpcs ; fi

after_success:
  - if [[ "$EXECUTE_COVERAGE" == "true" ]]; then wget https://scrutinizer-ci.com/ocular.phar ; fi
  - if [[ "$EXECUTE_COVERAGE" == "true" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover ; fi

Disable XDebug when not needed
Disable XDebug when not needed