phpstan/phpstan-symfony
PHPStan extension for Symfony that improves static analysis with precise return types and framework-specific rules. Understands container/services, parameters, controllers, request/headers, serializer, forms, messenger handlers, cache callbacks, config tree builders, and more.
HandleTrait support to ensure accurate return types in query buses (e.g., for domain-driven design).HandleTrait."This package supercharges our Symfony codebase by automatically catching type-related bugs during development—saving hours in debugging and reducing production incidents. For example, it flags undefined services or invalid console command arguments before they reach QA. With minimal setup (a one-line Composer install), we get enterprise-grade type safety for free, aligning with our investment in PHPStan. The ROI? Fewer fire drills, faster onboarding for new devs, and code that’s easier to refactor."
*"phpstan/phpstan-symfony turns PHPStan into a Symfony powerhouse. It resolves ambiguous return types in:
ContainerInterface::get() now returns the exact service type).FormInterface::getErrors() respects $deep/$flatten parameters).HandleTrait::handle() infers query bus return types).Setup: Add to composer.json, configure extension.neon with your container.xml, and run phpstan analyze. No runtime overhead—just pure static analysis. Pro tip: Pair with phpstan/extension-installer for zero-config installs."*
Key Selling Points:
How can I help you explore Laravel packages today?