sudo: false

language: php

dist: trusty

php:
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - hhvm

before_script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then composer require satooshi/php-coveralls:1.* squizlabs/php_codesniffer:2.* -n ; fi
  - if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then composer install -n ; fi

script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
  - if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then vendor/bin/phpunit ; fi
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then vendor/bin/phpcs ; fi

after_script:
  - if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then php vendor/bin/coveralls --coverage_clover=clover.xml -v ; fi

notifications:
  slack: slimphp:0RNzx2JuhkAqIf0MXcUZ0asT
