drenso/phan-extensions
PhanExtensions provides plugins and stubs for Phan static analysis: Symfony annotation import checking, docblock @method/@throws usage, and inline var comment scanning. Includes stubs for curl, intl, ldap, pdo, radius, and sockets. Not actively maintained.
Symfony\Component\HttpKernel\Annotation).curl, intl, or pdo with custom logic.composer.json (or CI/CD pipelines).HttpKernel) may still use older annotation formats.ThrowsPlugin is obsolete).@throws support).SymfonyAnnotationPlugin may misclassify annotations, leading to noisy warnings or missed issues.framework/src) to gauge accuracy.curl) adds analysis time. Benchmark with a large Laravel app (e.g., 50K+ LOC).Route, Middleware) that could benefit from similar plugins?php-cs-fixer)?Tooling Stack:
phan-storm).Overlap with Existing Tools:
| Tool | Purpose | Conflict Risk |
|---|---|---|
| PHPStan | Static analysis | High (duplicate effort) |
| Psalm | Static analysis | High |
| Pest | Testing framework | Low |
php-cs-fixer |
Code style | Low |
Recommendation: Use Phan for extension stubbing and annotation parsing, while delegating general type checking to PHPStan/Psalm.
SymfonyAnnotationPlugin and curl/intl stubs.phan-extensions plugins with native Phan/PHPStan features as they mature.Route).ThrowsPlugin).phan.config.php for Laravel:
return [
'target_php_version' => '8.0',
'plugins' => [
'vendor/drenso/phan-extensions/Plugin/Annotation/SymfonyAnnotationPlugin.php',
'vendor/drenso/phan-extensions/Plugin/DocComment/InlineVarPlugin.php',
],
'stubs' => [
'vendor/drenso/phan-extensions/Stubs/curl',
'vendor/drenso/phan-extensions/Stubs/intl',
],
'directory_list' => [
'app/',
'config/',
'database/',
'routes/',
'vendor/drenso/phan-extensions/Stubs',
],
'exclude_analysis_directory_list' => [
'vendor/',
'vendor/drenso/phan-extensions/Stubs',
],
];
name: Phan Static Analysis
on: [push, pull_request]
jobs:
phan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- run: composer require --dev phan/drenso/phan-extensions
- run: vendor/bin/phan -d app/ --allow-test-incompatible-usage
SymfonyAnnotationPlugin and test with Symfony-heavy modules.intl).phan-extensions with native solutions where possible.ThrowsPlugin) are redundant in newer Phan versions.phan-extensions repo for patches.Route annotations).phan-extensions; rely on:
How can I help you explore Laravel packages today?