language: php

sudo: false

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

matrix:
    include:
        - php: 5.3
          env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
        - php: 5.4
        - php: 5.5
        - php: 5.6
        - php: 7.0
          env: DEPENDENCIES=dev
        - php: hhvm

before_script:
    - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
    - composer update $COMPOSER_FLAGS

script: phpunit --coverage-text --coverage-clover=coverage.clover

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