language: php

# php compatibility
php:
  - 7.0
  - 7.1
  - 7.2

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

before_script:
  - travis_retry composer self-update
  - travis_retry composer install --no-interaction --prefer-dist

script:
  - mkdir -p build/tests/
  - vendor/bin/parallel-lint src/ tests/
  - vendor/bin/phpcs -sp src/ tests/
  - vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
  - vendor/bin/phpunit --coverage-text --coverage-clover=build/tests/coverage.xml
  - vendor/bin/phpstan.phar analyse --level max src/ tests/

after_script:
  # upload to scrutinizer
  - |
    if [[ $TRAVIS_PHP_VERSION == '7.0' ]]; then
      wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover build/tests/coverage.xml
    fi

notifications:
  email: false

language: php

# php compatibility
php:
  - 7.0
  - 7.1
  - 7.2

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

before_script:
  - travis_retry composer self-update
  - travis_retry composer install --no-interaction --prefer-dist
  - |
    if [[ $TRAVIS_PHP_VERSION != '7.0' ]]; then
        phpenv config-rm xdebug.ini
    fi

script:
  - mkdir -p build/tests/
  - vendor/bin/parallel-lint src/ tests/
  - vendor/bin/phpcs -sp src/ tests/
  - vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
  - vendor/bin/phpunit --coverage-text --coverage-clover=build/tests/coverage.xml
  - vendor/bin/phpstan.phar analyse --level max src/ tests/

after_script:
  # upload to scrutinizer
  - |
    if [[ $TRAVIS_PHP_VERSION == '7.0' ]]; then
      wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover build/tests/coverage.xml
    fi

notifications:
  email: false

Remove xdebug if not running on code coverage version
Remove xdebug if not running on code coverage version
