language: php
php:
  - "5.6"
  - "5.5"
  - "5.4"
  - "7.0"
  - "7.1"
  - hhvm
  - nightly
  - "5.3"


matrix:
    allow_failures:
    - php: nightly
    - php: hhvm
    - php: "5.3"

os:
  - linux
  
dist: trusty

install:
  # Install composer packages, will also trigger dump-autoload
  - composer install --no-interaction
  # Install coveralls.phar
  - wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
  - chmod +x coveralls.phar
  - php coveralls.phar --version

before_script:
    - mkdir -p build/logs
    - ls -al

script:
 - mkdir -p build/logs
 - if [ $(phpenv version-name) = 'hhvm' ]; then echo 'xdebug.enable=1' >> /etc/hhvm/php.ini; fi
 - phpunit --stderr --coverage-clover build/logs/clover.xml

after_script:
 - php vendor/bin/coveralls -v

after_success:
 - travis_retry php coveralls.phar -v

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