language: php
sudo: false

php:
  - 7.1
  - 7.2

env:
  global:
    - coverage=no
  matrix:
    - setup=basic
    - setup=lowest
    - setup=stable

before_script:
  - composer config discard-changes true
  - if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction; fi
  - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi
  - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
  - if [[ $setup = 'coveralls' ]]; then travis_retry composer require "php-coveralls/php-coveralls=^2.1" --prefer-dist --no-interaction --dev; fi

script:
  - if [[ $coverage = 'yes' ]]; then vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; fi
  - if [[ $coverage = 'no' ]]; then vendor/bin/phpunit -c phpunit.xml --testdox; fi

after_script:
  - if [[ $setup = 'coveralls' ]]; then php vendor/bin/coveralls -v; fi

matrix:
  include:
    - php: 7.1
      env: setup=coveralls coverage=yes
  allow_failures:
    - env: setup=coveralls coverage=yes
  fast_finish: true

language: php
sudo: false

php:
  - 7.1
  - 7.2
  - nightly

env:
  global:
    - coverage=no
  matrix:
    - setup=basic
    - setup=lowest
    - setup=stable

before_script:
  - composer config discard-changes true
  - if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction; fi
  - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi
  - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
  - if [[ $setup = 'coveralls' ]]; then travis_retry composer require "php-coveralls/php-coveralls=^2.1" --prefer-dist --no-interaction --dev; fi

script:
  - if [[ $coverage = 'yes' ]]; then vendor/bin/phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; fi
  - if [[ $coverage = 'no' ]]; then vendor/bin/phpunit -c phpunit.xml --testdox; fi

after_script:
  - if [[ $setup = 'coveralls' ]]; then php vendor/bin/coveralls -v; fi

matrix:
  include:
    - php: 7.1
      env: setup=coveralls coverage=yes
  allow_failures:
    - env: setup=coveralls coverage=yes
  fast_finish: true

Update to test against php nightly.
Update to test against php nightly.

Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
