language: php

services:
    - docker

sudo: false

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

addons:
    apt:
        packages:
            - pandoc

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

script:
    - ./vendor/bin/phpunit

jobs:
    include:

        #
        # Tests
        #

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

        #
        # Quality
        #

        - name: Code Coverage
          php: 7.4
          script:
              - ./vendor/bin/phpunit --coverage-clover=coverage.xml
              - bash <(curl -s https://codecov.io/bash)

        - name: Static Analysis
          php: 7.4
          script:
              - docker pull phpstan/phpstan
              - docker run --rm -v $TRAVIS_BUILD_DIR:/app phpstan/phpstan analyse --level 5 --no-interaction --no-progress /app/src

        - name: Coding Standards
          php: 7.4
          script:
              - wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
              - php php-cs-fixer fix --dry-run --diff --using-cache=no -vvv

language: php

services:
    - docker

sudo: false

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

addons:
    apt:
        packages:
            - pandoc

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

script:
    - ./vendor/bin/phpunit

jobs:
    include:

        #
        # Tests
        #

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

        #
        # Quality
        #

        - name: Code Coverage
          php: 7.4
          script:
              - ./vendor/bin/phpunit --coverage-clover=coverage.xml
              - bash <(curl -s https://codecov.io/bash)

        - name: Static Analysis
          php: 7.4
          script:
              - docker pull phpstan/phpstan
              - docker run --rm -v $TRAVIS_BUILD_DIR:/app phpstan/phpstan analyse --level 5 --no-interaction --no-progress /app/src

        - name: Coding Standards
          php: 7.4
          before_script:
              - wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
          script:
              - php php-cs-fixer fix --dry-run --diff --no-interaction --show-progress=none --using-cache=no -vvv

Remove unecessary composer install for cs check step
Remove unecessary composer install for cs check step
