language: php

jobs:
  include:
    - &COLLECT_CODE_COVERAGE

      stage: Collect Code Coverage

      php: 7.1

      if: type = pull_request

      before_install:
        - ./tools/composer clear-cache

      install:
        - travis_retry ./tools/composer update --no-ansi --no-interaction --no-progress --no-suggest

      before_script:
        - echo 'zend.assertions=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
        - echo 'assert.exception=On' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

      script:
        - ./phpunit --coverage-clover=coverage.xml

      after_success:
        - bash <(curl -s https://codecov.io/bash)

    - <<: *COLLECT_CODE_COVERAGE

      php: 7.2

    - <<: *COLLECT_CODE_COVERAGE

      php: 7.3

notifications:
  email: false
