language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0

sudo: false

env:
  global:
    - DEFAULT=1

matrix:
  fast_finish: true
  include:
    - php: 7.0
      env: PHPCS=1
    - php: 7.0
      env: CODECOVERAGE=1 DEFAULT=0

install:
  - composer self-update
  - composer install --prefer-dist

before_script:
  - phpenv rehash
  - set +H

script:
  - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit; fi"

  - sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi"

after_success:
  - bash <(curl -s https://codecov.io/bash)
  
notifications:
  email: false
language: php

php:
  - 5.4

sudo: false

env:
  global:
    - DEFAULT=1

matrix:
  fast_finish: true
  include:
    - php: 7.0
      env: PHPCS=1
    - php: 7.0
      env: CODECOVERAGE=1 DEFAULT=0

install:
  - composer self-update
  - composer install --prefer-dist

before_script:
  - phpenv rehash
  - set +H

script:
  - sh -c "if [ '$DEFAULT' = '1' ]; then phpunit --stderr; fi"

  - sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi"

  - sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml || true; fi"

after_success:
  - bash <(curl -s https://codecov.io/bash)
  
notifications:
  email: false
Disable other versions of php, enable code coverage
Disable other versions of php, enable code coverage
