language: php
dist: trusty
sudo: false

matrix:
    include:
        - php: 7.1
          env: COMPOSER_FLAGS="--prefer-lowest"
        - php: 7.2
          env: CS_FIXER=1
        - php: 7.3
        - php: 7.4
    fast_finish: true

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

before_install:
    - phpenv config-rm xdebug.ini || true

before_script:
    - composer self-update
    - composer update $COMPOSER_FLAGS --prefer-dist

script:
    - stty cols 120
    - if [ "$CS_FIXER" == 1 ]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.13.1/php-cs-fixer.phar && php php-cs-fixer.phar fix --dry-run --diff; fi
    - php vendor/bin/phpunit
