language: php

php:
  - 5.6
  - 7.0
  - 7.1
  - 7.2
  - hhvm

sudo: false

env:
  global:
    - PHPUNIT=1

matrix:
  fast_finish: true

  include:
    - php: 7.2
      env: PHPCS=1 PHPUNIT=0

  allow_failures:
    - php: hhvm

before_script:
  - composer self-update
  - composer install --prefer-dist --no-interaction

script:
  - sh -c "if [ '$PHPUNIT' = '1' ]; then ./bin/phpunit; fi"

  - sh -c "if [ '$PHPCS' = '1' ]; then ./bin/phpcs -p --extensions=php --standard=PSR2 --error-severity=1 --warning-severity=0 ./src ./tests; fi"
