language: php

sudo: false

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - hhvm

matrix:
  allow_failures:
    - php: hhvm
  include:
    - php: 5.4
      env:
        - COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
        - PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml --stop-on-error"
        - COVERAGE=true

install:
  - travis_retry composer self-update
  - travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
  - npm install

script: vendor/bin/phpunit ${PHPUNIT_FLAGS}

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