PHPStan
PHPStan is a static analysis tool for PHP that finds bugs without running the code, by reading the source, its type declarations, and its docblocks, and checking them for consistency.
PHPStan is able to:
- Detect type errors, such as calling a method that does not exist or passing the wrong type to a function
- Understand the generics-like docblock type language, like
list<Order>,array<string, Money>, used across the PHP ecosystem - Enforce increasingly strict checking through numbered rule levels
- Be extended with custom rules and framework-specific extensions
- Run in continuous integration to catch regressions before deployment.
See Also
Related
- Static Code Analysis (SCA)
- Psalm
- Docblock
- Type Checking
- Type Parametricity
- Continuous Integration (CI)
- Linting