language: php
sudo: false

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

matrix:
  include:
    # Test the latest dependencies
    - php: 7.1
    - php: 7.2

    # Test with the lowest dependencies
    - php: 7.2
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"

before_script:
  # Remove xdebug at the start
  - phpenv config-rm xdebug.ini
  - pecl install -f mongodb-stable
  - composer config "platform.ext-mongo" "1.6.16"
  - composer self-update
  # To be removed when this issue is resolved: https://github.com/composer/composer/issues/5355
  - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
  - composer update -v ${COMPOSER_FLAGS}
  # Restore xdebug for code coverage
  - echo "zend_extension=xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

script:
  - ./vendor/bin/phpunit --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

language: php
sudo: false

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

matrix:
  include:
    # Test the latest dependencies
    - php: 7.1
    - php: 7.2

    # Test with the lowest dependencies
    - php: 7.2
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"

before_script:
  # Remove xdebug at the start
  - phpenv config-rm xdebug.ini
  - pecl install -f mongodb-stable
  # Until doctrine/mongo switches to mongodb driver
  - composer config "platform.ext-mongo" "1.6.16"
  - composer self-update
  # To be removed when this issue is resolved: https://github.com/composer/composer/issues/5355
  - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
  - composer update -v ${COMPOSER_FLAGS}
  # Restore xdebug for code coverage
  - echo "zend_extension=xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

script:
  - ./vendor/bin/phpunit --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

Add a comment about the need for the composer hack
Add a comment about the need for the composer hack
