language: php

sudo: false

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

php:
  - 7.1
  - 7.2
  - 7.3

env:
  - COMMONMARK_VERSION=~0.19.3
  - COMMONMARK_VERSION=^1.0

before_script:
  - if [ $TRAVIS_PHP_VERSION = '7.3' ]; then PHPUNIT_COVERAGE="--coverage-clover=coverage.clover"; fi
  - if [ $TRAVIS_PHP_VERSION = '7.1' ]; then COMPOSER_FLAGS="--prefer-lowest"; fi
  - composer self-update
  - composer require "league/commonmark:${COMMONMARK_VERSION}" --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
  - if [ $COMMONMARK_VERSION != '~0.19.3' ]; then ./run analyse; fi
  - ./run test $PHPUNIT_COVERAGE

after_script:
  - if [[ "$PHPUNIT_COVERAGE" != "" ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

language: php

sudo: false

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

php:
  - 7.1
  - 7.2
  - 7.3

env:
  - COMMONMARK_VERSION=~0.19.3
  - COMMONMARK_VERSION=^1.0

before_script:
  - if [ $TRAVIS_PHP_VERSION = '7.3' ]; then PHPUNIT_COVERAGE="--coverage-clover=coverage.clover"; fi
  - if [ $TRAVIS_PHP_VERSION = '7.1' ]; then COMPOSER_FLAGS="--prefer-lowest"; fi
  - composer self-update
  - composer require "league/commonmark:${COMMONMARK_VERSION}" --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
  - if [ $COMMONMARK_VERSION != '~0.19.3' ] &&  [ $TRAVIS_PHP_VERSION != '7.1' ]; then ./run analyse; fi
  - ./run test $PHPUNIT_COVERAGE

after_script:
  - if [[ "$PHPUNIT_COVERAGE" != "" ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

Disable analyse for php 7.1
chore: Disable analyse for php 7.1
