---
language: php
sudo: false
env:
  global:
    - GH_REF: github.com/shrikeh/teapot.git
    - secure: "h8Q6F3ThS/pwBDMUg3Vj5zKqVhk2Birt1cZkbIxiFOMI2ptKHg+j6m9n3HTMRZq1jdEUrqnbqME3cCAAIs70dvw24ByeS7GJxzaBNLf/uA2nt6+6BiGvbAUqkVsCEMSyr7QqzsYMdbeGxEViuvgxhp3x6Fy9jIRz4kNdYJvzFUU="

matrix:
  include:
    - php: 5.3
      before_install:
        - phpenv config-rm xdebug.ini
    - php: 5.4
      before_install:
        - phpenv config-rm xdebug.ini
    - php: 5.5
      before_install:
        - phpenv config-rm xdebug.ini
    - php: 5.6
      before_install:
        - phpenv config-rm xdebug.ini
    - php: hhvm
    - php: 7.0
      before_install:
        - phpenv config-rm xdebug.ini
  allow_failures:
    - php: 5.3
    - php: 5.4
  fast_finish: true

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

before_install:
  - composer self-update
  - composer validate

install:
  - composer install --prefer-dist

script:
  - bin/phpcs --standard=phpcs.xml src
...

---
language: php
sudo: false
env:
  global:
    - GH_REF: github.com/shrikeh/teapot.git
    - secure: "h8Q6F3ThS/pwBDMUg3Vj5zKqVhk2Birt1cZkbIxiFOMI2ptKHg+j6m9n3HTMRZq1jdEUrqnbqME3cCAAIs70dvw24ByeS7GJxzaBNLf/uA2nt6+6BiGvbAUqkVsCEMSyr7QqzsYMdbeGxEViuvgxhp3x6Fy9jIRz4kNdYJvzFUU="

matrix:
  include:
    - php: 5.3
    - php: 5.4
    - php: 5.5
    - php: 5.6
    - php: hhvm
    - php: 7.0
  allow_failures:
    - php: 5.3
    - php: 5.4
  fast_finish: true

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

before_install:
# Remove xdebug as per https://getcomposer.org/doc/articles/troubleshooting.md#xdebug-impact-on-composer
  - if [ "$TRAVIS_PHP_VERSION" != 'hhvm' ]; then phpenv config-rm xdebug.ini; fi
  - composer self-update
  - composer validate

install:
  - composer install --prefer-dist

script:
  - bin/phpcs --standard=phpcs.xml src
...

Simplify `before_install` to use `if` based on HHVM
Simplify `before_install` to use `if` based on HHVM
