language: php

php:
  - 7.3
  - 8.0

env:
  - LARAVEL_VERSION=6.2
  - LARAVEL_VERSION=6.3
  - LARAVEL_VERSION=6.4
  - LARAVEL_VERSION=6.5
  - LARAVEL_VERSION=7.0
  - LARAVEL_VERSION=8.0

matrix:
  exclude:
    - php: 8.0
      env: LARAVEL_VERSION=6.2
    - php: 8.0
      env: LARAVEL_VERSION=6.3
    - php: 8.0
      env: LARAVEL_VERSION=6.4
    - php: 8.0
      env: LARAVEL_VERSION=6.5
    - php: 8.0
      env: LARAVEL_VERSION=7.0

before_install:
  - composer self-update >/dev/null 2>&1
  - composer require laravel/framework:${LARAVEL_VERSION} --no-update

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

script: composer run-script test

after_success:
  - "if [ $LARAVEL_VERSION = '8.0' ]; then vendor/bin/phpstan analyse -c phpstan.neon ./src/; fi"
  - "if [ $LARAVEL_VERSION = '8.0' ]; then php vendor/bin/phpcs --standard=PSR12 ./src/; fi"
  - "if [ $LARAVEL_VERSION = '8.0' ]; then php vendor/bin/coveralls -v; fi"

notifications:
  email:
    - hello@hisorange.me
# Thanks for this awesome service @TravisCI!
