Psalm
Psalm is a static analysis tool for PHP, developed to find type errors and bugs by reading docblock type annotations and inferring types across the codebase without running it.
Psalm is able to:
- Detect type errors, dead code, and impossible conditions
- Infer and check the generics-like docblock type language used across the PHP ecosystem, including template covariance and conditional types
- Enforce increasingly strict checking through configurable error levels
- Perform taint analysis to trace untrusted input through the codebase
- Run in continuous integration alongside tools such as PHPStan.
See Also
Related
- Static Code Analysis (SCA)
- PHPStan
- Docblock
- Type Checking
- Type Parametricity
- Taint Analysis
- Continuous Integration (CI)