language: php
dist: trusty

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

before_install:
  - composer selfupdate

install: composer update --prefer-dist --no-interaction

script:
  - ./vendor/bin/phpunit --coverage-clover=coverage.clover

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover

notifications:
  email:
    recipients:
      - portey@gmail.com
      - a@viniychuk.com
    on_success: change
    on_failure: always

language: php

matrix:
  include:
    - php: 5.5
      dist: trusty
    - php: 5.6
    - php: 7.0
    - php: 7.1
    - php: 7.2
    - php: 7.3
      env: STATIC_ANALYSIS=true

install: composer install --prefer-dist --no-interaction

script:
  - ./vendor/bin/phpunit --coverage-clover=coverage.clover
  - |
    if [[ $STATIC_ANALYSIS == true ]]; then
      composer require --ignore-platform-reqs --dev phpstan/phpstan
      vendor/bin/phpstan analyze src --level max
    fi

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover

notifications:
  email:
    recipients:
      - portey@gmail.com
      - a@viniychuk.com
    on_success: change
    on_failure: always

Rewrite the Travis CI configuraiton to use a matrix
Rewrite the Travis CI configuraiton to use a matrix

Now we install phpstan and run it during the PHP 7.3 stage