language: php

php:
    - 7.1
    - 7.2
    - 7.3
    - nightly

env:
    - dependencies=highest
    - dependencies=lowest

matrix:
    fast_finish: true
    allow_failures:
        - php: nightly

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

stages:
    - Code style & static analysis
    - Test
    - Code coverage

jobs:
    include:
        - stage: Code style & static analysis
          name: PHP CS Fixer
          script: composer phpcs
          env: dependencies=highest
        - name: PHPStan
          script: composer phpstan
          env: dependencies=highest
        - stage: Code coverage
          php: 7.3
          env: dependencies=highest
          script: vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
          after_success:
              - travis_retry php vendor/bin/php-coveralls --verbose
install:
    - if [ "$dependencies" = "lowest" ]; then composer update --no-interaction --prefer-lowest --prefer-dist; fi;
    - if [ "$dependencies" = "highest" ]; then composer update --no-interaction --prefer-dist; fi;

script:
    - composer tests

language: php

php:
    - 7.1
    - 7.2
    - 7.3
    - 7.4snapshot

env:
    - dependencies=highest
    - dependencies=lowest

matrix:
    fast_finish: true
    allow_failures:
        - php: nightly

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

stages:
    - Code style & static analysis
    - Test
    - Code coverage

jobs:
    include:
        - stage: Code style & static analysis
          name: PHP CS Fixer
          script: composer phpcs
          env: dependencies=highest
        - name: PHPStan
          script: composer phpstan
          env: dependencies=highest
        - stage: Code coverage
          php: 7.3
          env: dependencies=highest
          script: vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
          after_success:
              - travis_retry php vendor/bin/php-coveralls --verbose
install:
    - if [ "$dependencies" = "lowest" ]; then composer update --no-interaction --prefer-lowest --prefer-dist; fi;
    - if [ "$dependencies" = "highest" ]; then composer update --no-interaction --prefer-dist; fi;

script:
    - composer tests

Test against PHP 7.4snapshot instead of nightly
Test against PHP 7.4snapshot instead of nightly
