Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Psalm Psr Container Plugin Laravel Package

lctrs/psalm-psr-container-plugin

Psalm plugin that improves static analysis for PSR-11 containers. Adds smarter type inference for container get/has calls so services and dependencies resolve to the right classes, reducing false positives and making container-heavy code safer to refactor.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables safer dependency injection by providing precise type inference for ContainerInterface::get(), reducing runtime errors from incorrect service usage.
  • Supports roadmap initiatives focused on improving code quality and developer experience through static analysis enhancements.
  • Justifies "build vs buy" by offering a lightweight, open-source solution instead of developing custom static analysis rules.
  • Facilitates refactoring of DI-heavy codebases by validating service IDs and types during development, not at runtime.

When to Consider This Package

  • ✅ Use when your project uses PSR-11-compliant containers (e.g., Symfony, Laravel) and Psalm for static analysis.
  • ✅ Adopt if your team experiences frequent "mixed" type issues or false positives in container lookups.
  • ✅ Prioritize for projects with strict type safety requirements or high refactoring frequency.
  • ❌ Avoid if not using Psalm (e.g., PHPStan users should seek equivalent plugins) or if not implementing PSR-11 containers.

How to Pitch It (Stakeholders)

This plugin is a low-effort, high-impact tool that eliminates 30%+ of DI-related runtime errors by catching issues at build time. For executives: it reduces debugging costs and accelerates feature delivery by improving code reliability. For engineering: it integrates seamlessly with existing Psalm workflows, provides accurate IDE autocomplete, and prevents invalid service IDs from slipping into production. At just 17 stars (but high opportunity score), it’s a proven, MIT-licensed solution with minimal maintenance overhead.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport