language: php

php:
  - 5.6
  - 7.0
  - 7.1
  - nightly

env:
  global:
    - PHPUNIT_BIN='vendor/bin/phpunit'
    - PHPUNIT_CONFIG='phpunit.xml.dist'
    - PHPUNIT_FLAGS='--stop-on-failure --verbose'
    - UPLOAD_CLOVER='wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.xml'
    - GUZZLE_VERSION="~6.2"

matrix:
  include:
    - php: '5.6'
      env:
          - PHPUNIT_FLAGS="--stop-on-failure --verbose --coverage-text --coverage-clover=coverage.xml"
  allow_failures:
    - php: nightly

before_script:
  - composer require guzzlehttp/guzzle:${GUZZLE_VERSION}

script : $PHPUNIT_BIN -c $PHPUNIT_CONFIG $PHPUNIT_FLAGS && if [ -f "coverage.xml" ]; then $UPLOAD_CLOVER; fi

language: php

php:
  - 5.6
  - 7.0
  - 7.1
  - nightly

env:
  global:
    - PHPUNIT_BIN='vendor/bin/phpunit'
    - PHPUNIT_CONFIG='phpunit.xml.dist'
    - PHPUNIT_FLAGS='--stop-on-failure --verbose'
    - GUZZLE_VERSION="~6.2"

matrix:
  include:
    - php: '5.6'
      env:
          - PHPUNIT_FLAGS="--stop-on-failure --verbose --coverage-text --coverage-clover=coverage.xml"
  allow_failures:
    - php: nightly

before_script:
  - composer require guzzlehttp/guzzle:${GUZZLE_VERSION}

script : $PHPUNIT_BIN -c $PHPUNIT_CONFIG $PHPUNIT_FLAGS

after_script:
  - |
    if [ -f "coverage.xml" ]; then
      echo 'sending clover to Scrutinizer'
      wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover coverage.xml
      echo 'done'
    fi
Send Clover in the 'after_script' section
Send Clover in the 'after_script' section
