tools:
  external_code_coverage:
    timeout: 1800
    runs: 3

build:
  environment:
    php:
      version: 7.2

  nodes:
    phpcs:
      tests:
        override:
          - phpcs-run src/ tests/

    static-analysis:
      environment:
        php:
          ini:
            'memory_limit': -1
      dependencies:
        override:
          - pecl install apcu
          - pecl install redis
          - pecl install memcached
          - composer stan-setup
      tests:
        override:
          - vendor/bin/phpstan.phar analyse src/
          - vendor/bin/psalm.phar --show-info=false

build_failure_conditions:
  - 'issues.count > 0'
  - 'project.metric_change("scrutinizer.test_coverage", < -0.01)'

tools:
  external_code_coverage:
    timeout: 1800
    runs: 3

build:
  environment:
    php:
      version: 7.2

  nodes:
    phpcs:
      tests:
        override:
          - phpcs-run src/ tests/

    static-analysis:
      environment:
        php:
          ini:
            'memory_limit': -1
      dependencies:
        override:
          - pecl install apcu
          - pecl install redis
          - pecl install memcached
          - composer stan-setup
      tests:
        override:
          - vendor/bin/phpstan.phar analyse src/
          - vendor/bin/psalm.phar --show-info=false

build_failure_conditions:
  # Issues reported by any analyzer (which generates report in checkstyle format) like phpcs
  - 'issues.count > 0'
  # Code Coverage decreased from previous inspection
  - 'project.metric_change("scrutinizer.test_coverage", < -0.01)'
  # Code Coverage drops below 90%
  - 'project.metric("scrutinizer.test_coverage", < 0.90)'

Mark build as failed if test coverage goes below 90%.
Mark build as failed if test coverage goes below 90%.
