language: php

sudo: false

matrix:
  include:
    - php: 5.5
      env:
        - COLLECT_COVERAGE=true
    - php: 5.6
      env:
        - COLLECT_COVERAGE=true
        - EXECUTE_CS_CHECK=true
    - php: 7.0
    - php: hhvm
  allow_failures:
    - php: 7.0
  fast_finish: true

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

install:
  - travis_retry composer install --prefer-dist

script:
  - if [ "$COLLECT_COVERAGE" != "true" ]; then phpunit; fi
  - if [ "$COLLECT_COVERAGE" == "true" ]; then phpunit --coverage-text --coverage-clover=coverage.clover; fi
  - if [ "$EXECUTE_CS_CHECK" == "true" ]; then vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi

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

language: php

sudo: false

matrix:
  include:
    - php: 5.5
      env:
        - COLLECT_COVERAGE=true
    - php: 5.6
      env:
        - COLLECT_COVERAGE=true
        - EXECUTE_CS_CHECK=true
    - php: 7.0
    - php: hhvm
  allow_failures:
    - php: 7.0
  fast_finish: true

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

before_install:
  - composer self-update
  - composer validate

install:
  - travis_retry composer install --prefer-dist

script:
  - if [ "$COLLECT_COVERAGE" != "true" ]; then phpunit; fi
  - if [ "$COLLECT_COVERAGE" == "true" ]; then phpunit --coverage-text --coverage-clover=coverage.clover; fi
  - if [ "$EXECUTE_CS_CHECK" == "true" ]; then vendor/bin/php-cs-fixer fix -v --diff --dry-run; fi

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

Update composer itself and validate
Fix: Update composer itself and validate
