language: php
php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1

env:
  global:
    - setup=basic

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

sudo: false

install:
  - if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-source; fi
  - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-stable; fi
  - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-lowest --prefer-stable; fi

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

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

notifications:
  email: false

branches:
  only:
    - master

language: php
php:
  - 5.6
  - 7.0
  - 7.1

env:
  global:
    - setup=basic

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

sudo: false

install:
  - if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-source; fi
  - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-stable; fi
  - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-lowest --prefer-stable; fi

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

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

notifications:
  email: false

branches:
  only:
    - master

Remove PHP versions below 5.6 for Travis CI
Remove PHP versions below 5.6 for Travis CI
