language: php

sudo: false

matrix:
  include:
    - php: 5.4
      env: PARSER_VERSION=^1.2
    - php: 5.4
      env: PARSER_VERSION=^2.0
    - php: 5.5
      env: PARSER_VERSION=^1.2
    - php: 5.5
      env: PARSER_VERSION=^2.0
    - php: 5.5
      env: PARSER_VERSION=^3.0
    - php: 5.6
      env: PARSER_VERSION=^1.2
    - php: 5.6
      env: PARSER_VERSION=^2.0
    - php: 5.6
      env: PARSER_VERSION=^3.0
    - php: 7.0
      env: PARSER_VERSION=^2.0
    - php: 7.0
      env: PARSER_VERSION=^3.0
    - php: 7.0
      env: PARSER_VERSION=^4.0
    - php: 7.1
      env: PARSER_VERSION=^3.0
    - php: 7.1
      env: PARSER_VERSION=^4.0
    - php: 7.2
      env: PARSER_VERSION=^3.0
    - php: 7.2
      env: PARSER_VERSION=^4.0
    - php: hhvm
      env: PARSER_VERSION=^1.2
      dist: trusty
    - php: hhvm
      env: PARSER_VERSION=^2.0
      dist: trusty
    - php: hhvm
      env: PARSER_VERSION=^3.0
      dist: trusty
  allow_failures:
    - php: hhvm
  fast_finish: true

before_install:
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'hhvm.jit = false' >> /etc/hhvm/php.ini ; fi
  - composer require "nikic/php-parser:${PARSER_VERSION}" --no-update

install: travis_retry composer install --no-interaction --prefer-source

script: make travis
