sudo: false
language: php

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

matrix:
  allow_failures:
    - php: hhvm

env:
    global:
        - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M="

addons:
  apt:
    packages:
      - graphviz
  code_climate:
    repo_token: 9d5714bfd25acc27c449c2d71cfb444351a3b91c59ed1a5dc3a50732d2bf45f0

before_script:
  ## Composer
  - composer self-update
  - composer install --prefer-source
  ## PHPDocumentor
  - mkdir -p build/docs
  - mkdir -p build/coverage

script:
  ## PHP_CodeSniffer
  - ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n
  ## PHP Copy/Paste Detector
  # - ./vendor/bin/phpcpd src/
  ## PHP Mess Detector
  - ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist
  ## PHPUnit
  - ./vendor/bin/phpunit -c ./ --coverage-text --coverage-html ./build/coverage
  ## PHPLOC
  - ./vendor/bin/phploc src/
  ## PHPDocumentor
  - ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --template="responsive-twig"

after_script:
  ## PHPDocumentor
  - bash .travis_shell_after_success.sh
  ## Scrutinizer
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
  ## CodeClimate
  - ./vendor/bin/test-reporter

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/0dbc70ac93ba40880eef
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: false     # default: false
