language: php

env:
  global:
    - XDEBUG_MODE=coverage

matrix:
  include:
    - php: 7.2
      env: PHPUNIT_VERSION=8

    - php: 7.4
      env: PHPUNIT_VERSION=9

    - php: 8.0
      env: PHPUNIT_VERSION=9

    - php: 8.1
      env: PHPUNIT_VERSION=9

sudo: false

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 install --dev --no-interaction --prefer-dist

script:
  - composer style:check
  - composer test:static
  - 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

env:
  global:
    - XDEBUG_MODE=coverage

matrix:
  include:
    - php: 7.2
      env: PHPUNIT_VERSION=8

    - php: 7.4
      env: PHPUNIT_VERSION=9

    - php: 8.0
      env: PHPUNIT_VERSION=9

    - php: 8.1
      env: PHPUNIT_VERSION=9

sudo: false

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
  - 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)

Use update in Travis CI
Use update in Travis CI
