language: php

matrix:
  include:
    - php: 5.6
    - php: 7.0
    - php: 7.1
      env:
        - ENABLE_XDEBUG=true
    - php: 7.1
      env:
        - ENABLE_DEVTOOLS=true
    - php: nightly
  allow_failures:
    - php: nightly
  fast_finish: true

os:
  - linux

sudo: false

cache:
  directories:
    - vendor/

before_script:
  - if [[ ! $ENABLE_XDEBUG ]]; then
      phpenv config-rm xdebug.ini || echo "ext-xdebug is not available, cannot remove it.";
    fi

script:
  - composer install
  - if [[ $ENABLE_XDEBUG ]]; then
      php vendor/bin/phpunit --coverage-clover clover.xml;
    else
      php vendor/bin/phpunit;
    fi
  - if [[ $ENABLE_DEVTOOLS ]]; then
      php vendor/bin/phpcs --standard=phpcs.xml;
    fi

after_script:
  >-
    if [[ $ENABLE_XDEBUG ]]; then
      composer require 'satooshi/php-coveralls:~1.0';
      echo 'json_path: coveralls-upload.json' > .coveralls.yml;
      php vendor/bin/coveralls -v --coverage_clover=clover.xml;
    fi

language: php

matrix:
  include:
    - php: 5.6
    - php: 7.0
    - php: 7.0
      env:
        - COMPOSER_FLAGS=--prefer-lowest
    - php: 7.1
      env:
        - ENABLE_XDEBUG=true
    - php: 7.1
      env:
        - ENABLE_DEVTOOLS=true
    - php: nightly
  allow_failures:
    - php: nightly
  fast_finish: true

os:
  - linux

sudo: false

cache:
  directories:
    - vendor/

before_script:
  - if [[ ! $ENABLE_XDEBUG ]]; then
      phpenv config-rm xdebug.ini || echo "ext-xdebug is not available, cannot remove it.";
    fi

script:
  - composer update $COMPOSER_FLAGS
  - if [[ $ENABLE_XDEBUG ]]; then
      php vendor/bin/phpunit --coverage-clover clover.xml;
    else
      php vendor/bin/phpunit;
    fi
  - if [[ $ENABLE_DEVTOOLS ]]; then
      php vendor/bin/phpcs --standard=phpcs.xml;
    fi

after_script:
  >-
    if [[ $ENABLE_XDEBUG ]]; then
      composer require 'satooshi/php-coveralls:~1.0';
      echo 'json_path: coveralls-upload.json' > .coveralls.yml;
      php vendor/bin/coveralls -v --coverage_clover=clover.xml;
    fi

Add a test layer on lowest dependencies.
Add a test layer on lowest dependencies.

This will help identify incompatible changes.
