Psalm is a static analysis tool for finding type-related errors and potential security vulnerabilities in PHP applications. It examines source code without running the application, using type inference and control-flow analysis to detect problems that conventional syntax checkers cannot identify.
Psalm can be introduced into existing projects with different levels of checking strictness. Its understanding of PHPDoc annotations makes it useful for applications that rely on types not fully expressed in native PHP declarations. It also provides dedicated facilities for tracing potentially unsafe data through an application.
This is free and open source software.
Key Features
- Detects invalid function calls, incompatible argument types and incorrect return values.
- Infers variable and expression types using control-flow information.
- Tracks mixed types and identifies situations where insufficient type information could conceal defects.
- Understands generic type annotations, array shapes, templates and advanced PHPDoc types.
- Checks logical assertions to identify contradictory conditions and unreachable code.
- Verifies that object properties are properly initialised.
- Performs taint analysis to trace untrusted data from sources to potentially unsafe operations.
- Can identify security problems involving unsanitised input and sensitive data flows.
- Provides configurable issue levels and suppression mechanisms for gradual adoption.
- Supports baseline files for recording existing problems.
- Offers automatic corrections for selected issues.
- Provides command-line refactoring capabilities for supported transformations.
- Includes a Language Server Protocol implementation for editor integration.
- Supports machine-readable diagnostic reports for automated testing and continuous integration.
Website: github.com/vimeo/psalm
Support:
Developer: Vimeo
License: MIT License
Psalm is written in PHP. Learn PHP with our recommended free books and free tutorials.
Related Software
| PHP Linters | |
|---|---|
| PHPStan | PHP static analysis tool |
| PHP Coding Standards Fixer | Fixes your code to follow the standards |
| Mago | Extremely fast PHP linter, formatter, and static analyzer |
| Psalm | Static analysis tool |
| Phan | Static analyzer for PHP |
| PHP_CodeSniffer | Tokenizes PHP files and detects violations |
| Deptrac | Static code analysis tool for PHP projects |
| PHP Parallel Lint | Checks the syntax of PHP files in parallel |
| PHPLint | Speed up linting PHP files |
| PHPCompatibility | Coding standard for PHP_CodeSniffer |
| PHPArkitect | Define architectural rules as executable PHP code |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.