language: php

sudo: false

env:
  global:
    - RUN_PHPCS="no"
    - COMPOSER_FLAGS="--prefer-stable"

matrix:
  include:
    - php: 5.3
    - php: 5.3
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
    - php: 5.4
    - php: 5.5
    - php: 5.6
      env: RUN_PHPCS="yes"
    - php: 7.0
    - php: 7.0
      # This empty flag removes the prefer-stable switch to cause dev dependencies to be installed
      env: COMPOSER_FLAGS=""
    - php: 7.1
    - php: nightly
  allow_failures:
    - php: nightly

before_script:
  - composer self-update
  - composer update $COMPOSER_FLAGS

script:
  - vendor/bin/phpunit
  - if [ "$RUN_PHPCS" == "yes" ]; then vendor/bin/phpcs -p --report=full --extensions=php --standard=.travis/phpcs/Joomla/ruleset.xml src/; fi;

language: php
sudo: false
dist: trusty

env:
  global:
    - RUN_PHPCS="no"
    - COMPOSER_FLAGS="--prefer-stable"

matrix:
  fast_finish: true
  include:
    - php: 5.3
      dist: precise
    - php: 5.3
      dist: precise
      env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
    - php: 5.4
    - php: 5.5
    - php: 5.6
      env: RUN_PHPCS="yes"
    - php: 7.0
    - php: 7.0
      # This empty flag removes the prefer-stable switch to cause dev dependencies to be installed
      env: COMPOSER_FLAGS=""
    - php: 7.1
    - php: 7.2
    - php: nightly
  allow_failures:
    - php: 7.2
    - php: nightly

before_script:
  - composer self-update
  - composer update $COMPOSER_FLAGS

script:
  - vendor/bin/phpunit
  - if [ "$RUN_PHPCS" == "yes" ]; then vendor/bin/phpcs -p --report=full --extensions=php --standard=.travis/phpcs/Joomla/ruleset.xml src/; fi;

Adjust Travis config for latest environment
Adjust Travis config for latest environment
