vimeo/psalm
Psalm is a PHP static analysis tool that finds type errors, dead code, and risky patterns before runtime. Add it to your CI to improve code quality, enforce stricter typing, and catch bugs early in applications and libraries.
--alter) can resolve ~40% of issues automatically, accelerating onboarding and reducing context-switching.TaintedLlmPrompt for prompt injection) to harden APIs against OWASP Top 10 risks. Prioritize fixes for high-severity issues like PossibleNullReference or InvalidArgument.PossibleNullReference in a payment-processing module that would have cost $50K+ to fix post-launch.@psalm-pure, @psalm-immutable).Adopt Psalm if:
Look elsewhere if:
"Psalm is a force multiplier for our PHP engineering team. By integrating this static analysis tool into our CI pipeline, we can:
Ask: "Should we allocate 2 dev-weeks to integrate Psalm into CI for our critical paths, with a goal of reducing PHP-related incidents by 30% in 6 months?"
"Psalm gives us superpowers for PHP development:
PossibleNullReference in our payment processor that would’ve caused a $50K outage.TaintedLlmPrompt for prompt injection. This is like a free security review for every PR.@psalm-pure and @psalm-immutable.--strict mode for APIs and gradually expand.How we’ll roll it out:
@psalm-param-type) and mutability rules.Ask: "Can we dedicate a backend engineer to configure Psalm for our critical paths and train the team? We’ll measure success by reduced PHP-related incidents and faster PR turnaround."
"Psalm is like a rubber duck for your code—it points out problems before you deploy:
eval() or unvalidated user input in SQL.--alter to auto-fix ~40% of issues (e.g., adding missing @var annotations).--show-snippet to see exactly where errors occur, like a mini-linter.How to start:
composer require vimeo/psalm../vendor/bin/psalm --init (generates config) then ./vendor/bin/psalm --strict.--no-cache to avoid false positives.Pro tip: Use @psalm-pure on helper functions to tell Psalm they’re side-effect-free, which improves type inference and security analysis.
Ask: "Who wants to be the Psalm champion for our team? We’ll pair you with a backend lead to get it running in CI."
How can I help you explore Laravel packages today?