language: php

php:
  - 7.0
  - hhvm

sudo: false

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

matrix:
  allow_failures:
    - php: hhvm

services: mongodb

before_script:
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "7.0" ]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
  - sh -c 'echo 'extension = "memcached.so"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini'
  - travis_retry composer self-update
  - travis_retry composer install --no-interaction --prefer-source

script:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover; fi
  - if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then ./vendor/bin/phpunit; fi

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

language: php

php:
  - 7.0
  - 7.1

sudo: false

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

matrix:
  allow_failures:
    - php: hhvm
      dist: trusty
  include:
    - php: hhvm
      dist: trusty

services: mongodb

before_script:
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "7.0" ]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
  - sh -c 'echo 'extension = "memcached.so"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini'
  - travis_retry composer self-update
  - travis_retry composer install --no-interaction --prefer-source

script:
  - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover; fi
  - if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then ./vendor/bin/phpunit; fi

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

Test on PHP7.1 and fix HHVM
Test on PHP7.1 and fix HHVM
