Code Quality

PHPStan Static Analysis

PHPStan analyzes PHP code without executing it and detects type errors and other defects early.

Overview

PHPStan analyzes PHP code without executing it and detects type errors and other defects early.

Example

composer require --dev phpstan/phpstan
vendor/bin/phpstan analyse src

Start with a manageable analysis level and increase strictness as the codebase improves.

Official website: PHPStan

Evaluation checklist

  • Prefer official documentation and repositories.
  • Check supported PHP versions and release history.
  • Review installation instructions and license terms.
  • Keep dependencies updated and run security checks.