dist: xenial

language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4

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

before_install:
  - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"

install: travis_retry composer update --prefer-dist

script:
  - ./vendor/bin/phpunit

jobs:
  allow_failures:
    - php: nightly

  include:
    - stage: Test
      php: nightly
      before_install:
        - composer config platform.php 7.4.99

    - stage: Lint
      before_script:
        - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.12.20
      script: vendor/bin/phpstan analyse -l 3 -c phpstan.neon lib tests
      php: 7.4

    - stage: Benchmark
      install:
        - travis_retry composer update --prefer-dist
        - curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
        - curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey
      script: php phpbench.phar run
      php: 7.4

dist: xenial

language: php

php:
  - 7.2
  - 7.3
  - 7.4

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

before_install:
  - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"

install: travis_retry composer update --prefer-dist

script:
  - ./vendor/bin/phpunit

jobs:
  allow_failures:
    - php: nightly

  include:
    - stage: Test
      php: nightly
      before_install:
        - composer config platform.php 7.4.99

    - stage: Lint
      before_script:
        - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.12.20
      script: vendor/bin/phpstan analyse -l 3 -c phpstan.neon lib tests
      php: 7.4

    - stage: Benchmark
      install:
        - travis_retry composer update --prefer-dist
        - curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
        - curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey
      script: php phpbench.phar run
      php: 7.4

Remove PHP 7.1 test run for now
Remove PHP 7.1 test run for now
