language: php

sudo: false

dist: bionic

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

matrix:
  include:
    - php: 7.2
    - php: 7.3
    - php: 7.4
    - php: nightly
  allow_failures:
    - php: nightly
  fast_finish: true

before_install:
  - cat $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/xdebug.ini > ./xdebug.ini
  - phpenv config-rm xdebug.ini || true
  - composer self-update
  - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;

before_script:
  - composer install --prefer-source
  - vendor/bin/parallel-lint --exclude vendor .
  - vendor/bin/php-cs-fixer fix --dry-run --diff
  - phpenv config-add ./xdebug.ini

after_script:
  - php vendor/bin/coveralls -v

after_success:
  - travis_retry php vendor/bin/php-coveralls -v

notifications:
  email:
    - thanhha.work@gmail.com
