language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - nightly
  - hhvm
  - hhvm-nightly

env: BUILD_TEST=false

# Add 7.2 with build testing and 5.3 on an older distro
matrix:
  include:
    - php: 7.2
      env: BUILD_TEST=true USE_COMPOSER=true
    - php: 5.3
      dist: precise

before_install:
  - nvm install 8
  - phpenv config-rm xdebug.ini || return 0

install:
  # Travis' HHVM version doesn't work with php-cs-fixer, and
  # we don't really need it unless we're on the $BUILD_TEST job
  - if $BUILD_TEST; then composer install; else composer remove --dev friendsofphp/php-cs-fixer; fi

script:
  - KINT_FILE=build/kint.phar php ./tests/basic.php
  - KINT_FILE=vendor/autoload.php php ./tests/basic.php
  - KINT_FILE=build/kint.phar php ./tests/phpunit-proxy.php -d error_reporting=-1 tests
  - php ./vendor/bin/phpunit -d error_reporting=-1 tests
  - if $BUILD_TEST; then composer clean && composer format && composer build && git status && git diff-files --quiet --exit-code; fi

language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - nightly
  - hhvm
  - hhvm-nightly

env: BUILD_TEST=false

# Add 7.2 with build testing and 5.3 on an older distro
matrix:
  include:
    - php: 7.2
      env: BUILD_TEST=true
    - php: 5.3
      dist: precise

before_install:
  - nvm install 8
  - phpenv config-rm xdebug.ini || return 0

install:
  # Travis' HHVM version doesn't work with php-cs-fixer, and
  # we don't really need it unless we're on the $BUILD_TEST job
  - if $BUILD_TEST; then composer install; else composer remove --dev friendsofphp/php-cs-fixer; fi

script:
  - KINT_FILE=build/kint.phar php ./tests/basic.php
  - KINT_FILE=vendor/autoload.php php ./tests/basic.php
  - KINT_FILE=build/kint.phar php ./tests/phpunit-proxy.php -d error_reporting=-1 tests
  - php ./vendor/bin/phpunit -d error_reporting=-1 tests
  - if $BUILD_TEST; then composer clean && composer format && composer build && git status && git diff-files --quiet --exit-code; fi

Remove old USE_COMPOSER env var
Travis: Remove old USE_COMPOSER env var
