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
Phpstan Symfony

Phpstan Symfony Laravel Package

lookyman/phpstan-symfony

PHPStan extension for Symfony projects. Improves static analysis with Symfony-specific type inference and container/framework awareness, helping catch bugs earlier and reduce false positives when analyzing services, controllers, and common Symfony patterns.

View on GitHub
Deep Wiki
Context7

Symfony extension for PHPStan

Frequently asked questions about Phpstan Symfony
Can I use lookyman/phpstan-symfony with Laravel 8/9 or Symfony 6/7?
No, this package is deprecated and only supports Symfony 2/3/4 and PHPStan 0.x. Modern Laravel/Symfony apps use PHPStan’s built-in Symfony extension or phpstan/extension-installer, which handle Symfony 5+/6+ and PHPStan 1.x natively.
How do I install this package in a Laravel project?
You can’t install it via Composer directly—it’s deprecated. If you’re on Symfony 3/4, manually add `lookyman/phpstan-symfony` to `composer.json` and lock PHPStan to `^0.12`, but expect conflicts with Laravel’s modern dependencies. For Laravel 8+, use `phpstan/extension-installer` instead.
Will this package work with PHP 8.0+?
No, it targets PHP 5.6–7.2. PHP 8.0+ introduces strict typing and deprecated function removals that will break this package. Modern PHPStan extensions (like `phpstan/symfony`) support PHP 8.x.
What are the risks of using this outdated package?
Critical risks include security vulnerabilities (unpatched dependencies), silent failures with Symfony 5+/6+, and conflicts with Laravel’s autoloader or modern PHPStan rules. It may also break during minor Symfony/PHP updates.
Is there a migration path from this package to modern PHPStan?
Yes, but it requires replacing `lookyman/phpstan-symfony` with `phpstan/extension-installer` and configuring `phpstan/symfony` (native extension). Start by running `phpstan upgrade` and gradually replacing custom rules with the new extension’s features.
Does this package support Symfony’s new attributes (PHP 8) or Messenger component?
No, it was built for Symfony 2/3/4 and lacks support for attributes, Messenger, or other Symfony 5+/6+ features. Modern PHPStan extensions cover these cases.
How do I configure PHPStan to avoid conflicts with this package?
Disable Symfony’s built-in PHPStan integration in `phpstan.neon` and explicitly configure `lookyman/phpstan-symfony` for legacy analysis. However, this is fragile—modern setups use `extensions:` in PHPStan’s config instead.
Are there alternatives for Symfony 3/4 projects?
For Symfony 3/4, consider forking this package (high effort) or manually writing PHPStan rules. For Symfony 5+, use `phpstan/symfony` (native extension) or `phpstan/doctrine` for Doctrine-specific analysis.
Will this package work with Laravel’s service container or bundles?
It may work partially for Symfony 3/4, but Laravel’s container and bundles (e.g., `laravel/framework`) rely on modern Symfony features this package ignores. Test thoroughly—expect breakage with Laravel 8+.
How do I test if this package is safe for my legacy project?
Run it in a staging environment with `--level=max` and log all errors. Compare results with `phpstan/symfony` (native) to identify gaps. If it fails, disable it and implement custom PHPStan rules for your Symfony 3/4 patterns.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky