language: php

services:
  - memcached

matrix:
  include:
    - php: 7.0
    - php: 7.1
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: 7.1
      env: COLLECT_COVERAGE="--coverage-clover build/coverage.clover"

before_script:
  - echo 'extension="memcached.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
  - travis_retry composer self-update
  - travis_retry composer update --no-interaction ${COMPOSER_FLAGS}

script:
  - vendor/bin/phpunit ${COLLECT_COVERAGE}

after_script:
  - if [[ $COLLECT_COVERAGE ]]; then travis_retry wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ $COLLECT_COVERAGE ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.clover; fi

language: php

services:
  - memcached

matrix:
  include:
    - php: 7.0
    - php: 7.1
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: 7.1
    - php: 7.2
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: 7.2
    - php: 7.3
      env: COMPOSER_FLAGS="--prefer-lowest"
    - php: 7.3
      env: COLLECT_COVERAGE="--coverage-clover build/coverage.clover"

before_script:
  - echo 'extension="memcached.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
  - travis_retry composer self-update
  - travis_retry composer update --no-interaction ${COMPOSER_FLAGS}

script:
  - vendor/bin/phpunit ${COLLECT_COVERAGE}

after_script:
  - if [[ $COLLECT_COVERAGE ]]; then travis_retry wget https://scrutinizer-ci.com/ocular.phar; fi
  - if [[ $COLLECT_COVERAGE ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.clover; fi

Test in newer PHP versions
Test in newer PHP versions
