language: php

php:
  - 7.2
  - 7.3
  - 7.4
  - 8.0

env:
  matrix:
    - COMPOSER_FLAGS=""
    - COMPOSER_FLAGS="--prefer-lowest"

stages:
  - test
  - test with coverage
  - infection

before_install: phpenv config-rm xdebug.ini || echo "xdebug not available"

install: travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest $COMPOSER_FLAGS -vv

script: vendor/bin/phpunit --colors --no-coverage

jobs:
  allow_failures:
    - php: nightly
  include:
    - php: nightly
      env: COMPOSER_FLAGS="--ignore-platform-reqs"

    - stage: test with coverage
      php: 7.3
      env: COMPOSER_FLAGS=""
      before_install: skip
      script: vendor/bin/phpunit --colors --coverage-clover=clover.xml --coverage-text
      after_success:
        - wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover clover.xml

    - stage: infection
      php: 7.3
      env: COMPOSER_FLAGS=""
      before_install: skip
      script: vendor/bin/infection --log-verbosity=none --threads=4 --min-covered-msi=68 --min-msi=68

language: php

php:
  - 7.4
  - 8.0

env:
  matrix:
    - COMPOSER_FLAGS=""
    - COMPOSER_FLAGS="--prefer-lowest"

stages:
  - test
  - test with coverage
  - infection

before_install: phpenv config-rm xdebug.ini || echo "xdebug not available"

install: travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest $COMPOSER_FLAGS -vv

script: vendor/bin/phpunit --colors --no-coverage

jobs:
  allow_failures:
    - php: nightly
  include:
    - php: nightly
      env: COMPOSER_FLAGS="--ignore-platform-reqs"

    - stage: test with coverage
      php: 7.4
      env: COMPOSER_FLAGS=""
      before_install: skip
      script: vendor/bin/phpunit --colors --coverage-clover=clover.xml --coverage-text
      after_success:
        - wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover clover.xml

    - stage: infection
      php: 7.4
      env: COMPOSER_FLAGS=""
      before_install: skip
      script: vendor/bin/infection --log-verbosity=none --threads=4 --min-covered-msi=68 --min-msi=68

Drop support of php 7.3 and 7.2
refactor: Drop support of php 7.3 and 7.2
