language: php

php:
  - 5.6
  - 7.0
  - 7.1
  - 7.2
  - 7.3
  - nightly

# We use a matrix to have access to old PHP versions, which requires to run old Ubuntu TravisCI build envs.
# https://docs.travis-ci.com/user/languages/php/#php-52x---53x-support-is-available-on-precise-only
# https://docs.travis-ci.com/user/reference/trusty#php-images
matrix:
  include:
    - php: 5.4
      dist: trusty
    - php: 5.5
      dist: trusty

install:
  # We do not use it in unit tests.
  - composer remove --dev friendsofphp/php-cs-fixer
  - composer install
script:
  - make test
  - make bench

jobs:
  include:
    - stage: checks
      install: composer install
      php:
        - 7.2
      script:
        - make cs-check
        # Ensure documentation has been generated:
        # * generate it locally (make doc) ;
        # * ensure git status gives no changes: if it does the doc wasn't properly
        # updated (this must make the CI build fail).
        - make doc || ./tools/hasGitChanges.sh

language: php

jobs:
  include:
    - stage: test
      php:
        - 5.6
        - 7.0
        - 7.1
        - 7.2
        - 7.3
        - nightly

      # We use a matrix to have access to old PHP versions, which requires to run old Ubuntu TravisCI build envs.
      # https://docs.travis-ci.com/user/languages/php/#php-52x---53x-support-is-available-on-precise-only
      # https://docs.travis-ci.com/user/reference/trusty#php-images
      matrix:
        include:
          - php: 5.4
            dist: trusty
          - php: 5.5
            dist: trusty

      install:
        # We do not use it in unit tests.
        - composer remove --dev friendsofphp/php-cs-fixer
        - composer install
      script:
        - make test
        - make bench

    - stage: checks
      install: composer install
      php:
        - 7.2
      script:
        - make cs-check
        # Ensure documentation has been generated:
        # * generate it locally (make doc) ;
        # * ensure git status gives no changes: if it does the doc wasn't properly
        # updated (this must make the CI build fail).
        - make doc || ./tools/hasGitChanges.sh

Add build matrix IN the jobs
Add build matrix IN the jobs
