cache:
  apt: true

language: php

notifications:
  email:
    on_success: never
    on_failure: change

php:
  - 7.1
  - 7.2
  - nightly

matrix:
  fast_finish: true
  include:
    # Run PHP CodeSniffer and XMLLint against just PHP 7.1 job.
    - php: 7.1
      env: SNIFF=1 LINT=1
      addons:
        apt:
          packages:
            - libxml2-utils

  allow_failures:
    # Allow failures for unstable builds.
    - php: 7.2
    - php: nightly

before_install:
  - export XMLLINT_INDENT="	"

install:
  - composer install

script:
  # Lint the PHP files against parse errors.
  - if [[ "$LINT" == "1" ]]; then if find src tests -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
  # Validate the xml files.
  # @link http://xmlsoft.org/xmllint.html
  - if [[ "$LINT" == "1" ]]; then xmllint --noout ./phpcs.xml.dist; fi
  - if [[ "$LINT" == "1" ]]; then xmllint --noout --schema ./vendor/phpunit/phpunit/phpunit.xsd ./phpunit.xml.dist; fi
  # Check coding standards.
  - if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs; fi
  # Run tests.
  - ./vendor/bin/phpunit

cache:
  apt: true

language: php

notifications:
  email:
    on_success: never
    on_failure: change

php:
  - 7.1
  - 7.2
  - nightly

matrix:
  fast_finish: true
  include:
    # Run PHP CodeSniffer and XMLLint against just PHP 7.1 job.
    - php: 7.1
      env: SNIFF=1 LINT=1
      addons:
        apt:
          packages:
            - libxml2-utils

  allow_failures:
    # Allow failures for unstable builds.
    - php: nightly

before_install:
  - export XMLLINT_INDENT="	"

install:
  - composer install

script:
  # Lint the PHP files against parse errors.
  - if [[ "$LINT" == "1" ]]; then if find src tests -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
  # Validate the xml files.
  # @link http://xmlsoft.org/xmllint.html
  - if [[ "$LINT" == "1" ]]; then xmllint --noout ./phpcs.xml.dist; fi
  - if [[ "$LINT" == "1" ]]; then xmllint --noout --schema ./vendor/phpunit/phpunit/phpunit.xsd ./phpunit.xml.dist; fi
  # Check coding standards.
  - if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs; fi
  # Run tests.
  - ./vendor/bin/phpunit

Stop PHP 7.2 from being an allowed failure in Travis CI
Stop PHP 7.2 from being an allowed failure in Travis CI
