language: php

php: [5.3, 5.4, 5.5, 5.6, 7.0, 7.1]

sudo: false

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

branches:
  except:
    - /^bugfix\/.*$/
    - /^feature\/.*$/
    - /^optimization\/.*$/

matrix:
  fast_finish: true
  include:
    # Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
    - php: hhvm
      sudo: required
      dist: trusty
      group: edge
    - php: '7.0'
      env: PHPDOCUMENTOR_REFLECTION_DOCBLOCK="^2.0"

before_script:
  - if [ -n "$PHPDOCUMENTOR_REFLECTION_DOCBLOCK" ]; then
      composer require "phpdocumentor/reflection-docblock:${PHPDOCUMENTOR_REFLECTION_DOCBLOCK}" --no-update;
    fi;
  - travis_retry composer update --no-interaction

script:
  - vendor/bin/phpspec run -fpretty -v
  - vendor/bin/phpunit
