sudo: false

language: php

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

matrix:
  fast_finish: true
  include:
    - php: 5.6
      env:
        - TEST_COVERAGE=true
    - php: 7
      env:
        - CS_CHECK=true
    - php: 7.1
    - php: hhvm 
  allow_failures:
    - php: hhvm

before_install:
  - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
  - composer self-update
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:^1.0 ; fi

install:
  - travis_retry composer install --no-interaction
  - composer info -i

script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
  - if [[ $CS_CHECK == 'true' ]]; then composer cs ; fi
  - if [[ $CS_CHECK == 'true' ]]; then composer license-check ; fi

after_script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer coveralls ; fi

notifications:
  email: true

sudo: false

language: php

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

matrix:
  fast_finish: true
  include:
    - php: 5.6
      env:
        - TEST_COVERAGE=true
    - php: 7
      env:
        - CS_CHECK=true
    - php: 7.1
    - php: hhvm
  allow_failures:
    - php: hhvm

before_install:
  - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
  - composer self-update
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:^1.0 ; fi
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update michaelmoussa/php-coverage-checker:^1.1.0 ; fi

install:
  - travis_retry composer install --no-interaction
  - composer info -i

script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage && vendor/bin/php-coverage-checker clover.xml 100 ; else composer test ; fi
  - if [[ $CS_CHECK == 'true' ]]; then composer cs ; fi
  - if [[ $CS_CHECK == 'true' ]]; then composer license-check ; fi

after_script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer coveralls ; fi

notifications:
  email: true

Check to ensure 100% test coverage is retained
Check to ensure 100% test coverage is retained
