language: php

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

env:
  global:
    - XDEBUG_MODE=coverage
  jobs:
    - PHPUNIT_VERSION=8
    - PHPUNIT_VERSION=9

php:
  - 7.2
  - 7.3
  - 7.4
  - 8.0
  - 8.1

jobs:
  exclude:
    - php: 7.2
      env: PHPUNIT_VERSION=9

before_install:
  - if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then composer self-update --1; fi

install:
  - if [ -e phpstan.phpunit${PHPUNIT_VERSION}.neon ]; then cp phpstan.phpunit${PHPUNIT_VERSION}.neon phpstan.neon; fi
  - composer require phpunit/phpunit:^${PHPUNIT_VERSION}.0 --update-no-dev --no-interaction --prefer-dist --no-progress --no-suggest --update-with-all-dependencies
  - travis_retry composer update --no-interaction --prefer-dist

script:
  - composer style:check
  - composer test:static -- --no-progress
  - if [ "$PHPUNIT_VERSION" == "8" ]; then composer test:default -- --coverage-clover=coverage.xml; fi
  - if [ "$PHPUNIT_VERSION" == "9" ]; then composer test:phpunit9 -- --coverage-clover=coverage.xml; fi

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

language: php

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

env:
  global:
    - XDEBUG_MODE=coverage
  jobs:
    - PHPUNIT_VERSION=8
    - PHPUNIT_VERSION=9

php:
  - 7.2
  - 7.3
  - 7.4
  - 8.0
  - 8.1

jobs:
  exclude:
    - php: 7.2
      env: PHPUNIT_VERSION=9

before_install:
  - if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then composer self-update --1; fi
  - if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then composer self-update --1; fi

install:
  - if [ -e phpstan.phpunit${PHPUNIT_VERSION}.neon ]; then cp phpstan.phpunit${PHPUNIT_VERSION}.neon phpstan.neon; fi
  - composer require phpunit/phpunit:^${PHPUNIT_VERSION}.0 --update-no-dev --no-interaction --prefer-dist --no-progress --no-suggest --update-with-all-dependencies
  - travis_retry composer update --no-interaction --prefer-dist

script:
  - composer style:check
  - composer test:static -- --no-progress
  - if [ "$PHPUNIT_VERSION" == "8" ]; then composer test:default -- --coverage-clover=coverage.xml; fi
  - if [ "$PHPUNIT_VERSION" == "9" ]; then composer test:phpunit9 -- --coverage-clover=coverage.xml; fi

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

Downgrade composer for PHP 7.3
Downgrade composer for PHP 7.3
