language: php

sudo: false

php:
  - 7.2
  - 7.3
  - 7.4
  - 8.0
  - 8.1
  - 8.2

matrix:
  include:
    - php: 5.6
      env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'

before_script:
  - travis_retry composer self-update
  - travis_retry composer install --no-interaction --prefer-source --dev
  - travis_retry phpenv rehash

script:
  - ./vendor/bin/phpcs --standard=psr2 src/
  - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
