Overview of Psalm features
6.xPsalm is a static analysis tool for PHP designed to find type-related bugs. Key features include:
- Mixed type warnings: Identifies
mixedplaceholder types that may mask bugs. - Intelligent logic checks: Detects redundant or impossible logical assertions (e.g.,
if ($a && !$a)orif ($a) {} elseif ($a) {}). - Property initialisation checks: Ensures all object properties are assigned values after the constructor completes.
- Taint analysis: Detects security vulnerabilities in your code.
- Language Server: Provides IDE compatibility via a Language Server protocol.
- Automatic fixes: Automatically resolves many identified issues.
- Automatic refactoring: Performs simple refactors via the command line.