group: travis_latest
language: php

matrix:
  include:
    - php: 7.1
      env: lowest=1
    - php: 7.2
      env: csfixer=1
    - php: 7.3
    - php: nightly

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

install:
  - phpenv config-rm xdebug.ini || true;
  - |
    if [ "$csfixer" != "1" ]; then
      composer remove --dev friendsofphp/php-cs-fixer;
    fi;
  - |
    if [ "$lowest" = "1" ]; then
      composer update --prefer-lowest --prefer-stable;
    else
      composer update;
    fi;

script:
  - |
    if [ "$csfixer" = "1" ]; then
      vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --diff-format=udiff --allow-risky=yes;
    fi;
  - php vendor/bin/phpunit;

group: travis_latest
language: php

php:
  - 7.3
  - 7.2
  - 7.1
  - nightly

matrix:
  include:
    - php: 7.1
      env: lowest=1
    - php: 7.2
      env: csfixer=1
  allow_failures:
    - php: nightly

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

install:
  - phpenv config-rm xdebug.ini || true;
  - |
    if [ "$csfixer" != "1" ]; then
      composer remove --dev friendsofphp/php-cs-fixer;
    fi;
  - |
    if [ "$lowest" = "1" ]; then
      composer update --prefer-lowest --prefer-stable;
    else
      composer update;
    fi;

script:
  - |
    if [ "$csfixer" = "1" ]; then
      vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --diff-format=udiff --allow-risky=yes;
    fi;
  - php vendor/bin/phpunit;

Allow PHP-nightly build to fail on CI, PHP v8 isn't compatible with released PHPUnit.
Allow PHP-nightly build to fail on CI, PHP v8 isn't compatible with released PHPUnit.
