language: php

matrix:
    include:
        -   php: 7.1
        -   php: 7.2
        -   php: 7.3
        -   php: 7.4snapshot
            env: PHP_CS_FIXER_IGNORE_ENV=1
        -   php: nightly
            env: PHP_CS_FIXER_IGNORE_ENV=1
    fast_finish: true

cache:
    directories:
        - vendor/
        - tools/

before_script:
    - echo $TRAVIS_PHP_VERSION
    - php -v
    - PHP_VERSION=$(php -r "echo PHP_VERSION;")
    - echo $PHP_VERSION
    - composer install -o -q --no-suggest
    - if [[ "$PHP_VERSION" == '7.3' ]]; then composer install satooshi/php-coveralls ; fi

script:
  - make phpcs
  - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi
  - mkdir -p build/logs
  - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi
  - if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi

after_script:
 - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi

language: php

matrix:
    include:
        - php: 7.1
        - php: 7.2
        - php: 7.3
        - php: 7.4snapshot
          env: PHP_CS_FIXER_IGNORE_ENV=1
        - php: nightly
          env: PHP_CS_FIXER_IGNORE_ENV=1
    fast_finish: true

cache:
    directories:
        - vendor/
        - tools/

before_script:
    - echo $TRAVIS_PHP_VERSION
    - php -v
    - PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;")
    - echo $PHP_VERSION
    - composer install -o -q --no-suggest
    - if [[ "$PHP_VERSION" == '7.3' ]]; then composer install satooshi/php-coveralls ; fi

script:
    - make phpcs
    - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi
    - mkdir -p build/logs
    - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi
    - if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi

after_script:
    - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi

Fix PHP version detection in Travis config
Fix PHP version detection in Travis config
