php-static-analysis/phpstan-extension
A PHPStan extension for PHP projects that adds custom rules and configuration to strengthen static analysis. Integrate it with PHPStan to catch potential issues earlier, enforce coding standards, and improve overall code quality in your development workflow.
composer require --dev php-static-analysis/phpstan-extension
composer.json and README first. Repository metadata is unavailable, so verify the supported PHPStan/PHP versions and the exact extension config file (extension.neon vs rules.neon) in vendor/php-static-analysis/phpstan-extension.phpstan.neon:
includes:
- vendor/php-static-analysis/phpstan-extension/extension.neon
vendor/php-static-analysis/phpstan-extension/README.mdvendor/php-static-analysis/phpstan-extension/extension.neonvendor/php-static-analysis/phpstan-extension/src/Attribute/@phpstan-ignore comment on a legacy or framework-magic method with the package's attribute, then run:
vendor/bin/phpstan analyse --debug
Confirm the error disappears only where expected and still appears elsewhere.#[StaticAnalysis\Suppress('Called dynamically by the router')]
public function dispatch(): void
{
}
The exact attribute class and arguments must come from the package source.phpstan analyse --no-progress, and include composer.lock in the cache key. PHPStan extension behavior can change with PHPStan internals.phpstan.neon. Verify registration with a deliberate test error and confirm it is suppressed only when the extension is loaded..neon file name before copying examples.phpstan.neon, the extension version, or attribute usage, clear the cache:
vendor/bin/phpstan clear-result-cache
vendor/bin/phpstan analyse -c phpstan.neon --debug -v
If the attribute still appears ignored, check the extension container registration and whether the attribute is on a node the package actually inspects.How can I help you explore Laravel packages today?