language: php
sudo: false

php:
  - 7.2
  - nightly

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

before_script:
  - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then PHPUNIT_FLAGS="--coverage-clover ./clover.xml"; else PHPUNIT_FLAGS=""; fi
  - composer update --prefer-source --ignore-platform-reqs

script:
  - ./vendor/bin/phpstan analyse
  - ./vendor/bin/phpunit $PHPUNIT_FLAGS
  - php examples/index.php > /dev/null
  - if php -i |grep -qE xdebug; then ./vendor/bin/infection; fi
  - ./vendor/bin/phpcs

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

language: php
sudo: false

php:
  - 7.2
  - nightly

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

before_script:
  - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then PHPUNIT_FLAGS="--coverage-clover ./clover.xml"; else PHPUNIT_FLAGS=""; fi
  - composer update --prefer-source --ignore-platform-reqs

script:
  - ./vendor/bin/phpstan analyse
  - ./vendor/bin/phpunit $PHPUNIT_FLAGS
  - php examples/index.php > /dev/null
  - if php -i |grep -qE xdebug; then ./vendor/bin/infection; fi
  - ./vendor/bin/phpcs

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

matrix:
  allow_failures:
  - php: nightly

Allow failures on nightly (phpstan currently segfaults)
Allow failures on nightly (phpstan currently segfaults)
