language: php
php:
  - 7.1
  - 7.2

sudo: false

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

matrix:
  fast_finish: true

before_script:
  - composer install --no-interaction
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then composer require php-coveralls/php-coveralls; fi;'
  - mkdir -p build/logs

script:
  - composer code-style
  - vendor/bin/phpunit -c phpunit.xml --coverage-clover=build/logs/clover.xml --coverage-text
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then php bin/php-coveralls -v; fi;'
