language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - hhvm

matrix:
  fast_finish: true
  include:
    - php: 5.3
      env: PHPCS=1

before_script:
  - composer self-update
  - composer install

script:
  - if [[ "$PHPCS" != "1" ]]; then mkdir -p build/logs; fi
  - if [[ "$PHPCS" != "1" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then ./vendor/bin/phpunit; fi
  - if [[ "$PHPCS" != "1" && "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then ./vendor/bin/phpunit --coverage-text; fi
  - if [[ "$PHPCS" == "1" ]]; then ./vendor/bin/phpcs --standard=PSR2 -np src/ tests/; fi

after_script:
  - if [[ "$PHPCS" != "1" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then ./vendor/bin/coveralls; fi
