sudo: false

language: php

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.php-cs-fixer

matrix:
  include:
    - php: 7.1
      env: COMPOSER_ARGUMENTS="--prefer-lowest --prefer-stable"
    - php: 7.1
    - php: 7.2
    - php: nightly
  allow_failures:
    - php: nightly
  fast_finish: true

before_script:
  - pecl install uopz || echo "Cound not install uopz" 1>&2
  - composer update --prefer-dist ${COMPOSER_ARGUMENTS}

script:
  - vendor/bin/phpunit --configuration phpunit.xml.dist --colors --coverage-clover=coverage.clover
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      vendor/bin/docheader check library tests
    fi
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      vendor/bin/php-cs-fixer --diff --dry-run --verbose fix
    fi

after_script:
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover coverage.clover
    fi

sudo: false

language: php

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.php-cs-fixer

matrix:
  include:
    - php: 7.1
      env: COMPOSER_ARGUMENTS="--prefer-lowest --prefer-stable"
    - php: 7.1
    - php: 7.2
    - php: nightly
      env: COMPOSER_ARGUMENTS="--ignore-platform-reqs"
  allow_failures:
    - php: nightly
  fast_finish: true

before_script:
  - pecl install uopz || echo "Cound not install uopz" 1>&2
  - composer update --prefer-dist ${COMPOSER_ARGUMENTS}

script:
  - vendor/bin/phpunit --configuration phpunit.xml.dist --colors --coverage-clover=coverage.clover
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      vendor/bin/docheader check library tests
    fi
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      vendor/bin/php-cs-fixer --diff --dry-run --verbose fix
    fi

after_script:
  - |
    if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then
      wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover coverage.clover
    fi

Use Composer "--ignore-platform-reqs" on 7.3 build
Use Composer "--ignore-platform-reqs" on 7.3 build

Currently the build is failing because "friendsofphp/php-cs-fixer" does
not support PHP 7.3, but since we do not execute it in PHP 7.3 we can
ignore it for now.

Signed-off-by: Henrique Moody <3be1622bc44cadc0ae4da5043bd847b230c854e8@gmail.com>
