sudo: false
dist: trusty
language: php

matrix:
    include:
        - php: 5.6
          env: COMPOSER_FLAGS="--prefer-lowest"
        - php: 5.6
        - php: 7.0
        - php: 7.1
        - php: 7.2
        - php: nightly
        - php: hhvm-3.24
          sudo: required
    fast_finish: true
    allow_failures:
        - php: nightly
        - php: hhvm-3.24

before_script:
  - composer update --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
  - ./vendor/bin/phpunit -v -c phpunit.xml.dist
  - ./vendor/bin/phpmd src/ text phpmd.xml.dist
  - |
        CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")
        if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
        vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}

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

sudo: false
dist: trusty
language: php

matrix:
    include:
        - php: 5.6
          env: COMPOSER_FLAGS="--prefer-lowest"
        - php: 5.6
        - php: 7.0
        - php: 7.1
        - php: 7.2
        - php: 7.3
        - php: 7.4
        - php: nightly
          sudo: required
    fast_finish: true
    allow_failures:
        - php: nightly

before_script:
  - composer update --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
  - ./vendor/bin/phpunit -v -c phpunit.xml.dist
  - ./vendor/bin/phpmd src/ text phpmd.xml.dist
  - |
        CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")
        if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
        vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}

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

Add support for builds with PHP 7.3 and 7.4, dropped support for hhvm-3.24
Add support for builds with PHP 7.3 and 7.4, dropped support for hhvm-3.24
