Using PHPStan in Travis CI

16 May 2017

If you run PHPStan on every commit, you find errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.

Requirements

Installation

phpstan-shim provides easy way to install PHPStan without the risk of conflicting dependencies.

Install the package

composer require --dev phpstan/phpstan-shim

PHPStan configuration

Travis Setup

script:
  - vendor/bin/phpstan.phar analyse -l max -c phpstan.neon src --no-interaction --no-progress

Done :-)