goaop/parser-reflection
Parser Reflection brings PHP's Reflection API to static analysis: parse source files into an AST and introspect classes, methods, and properties without autoloading, including, or executing code. Drop-in compatible with native Reflection classes for analyzers, generators, and IDE tooling.
goaop/parser-reflection is framework-agnostic PHP tooling, not a Laravel package. Its best fit is build-time/CI static analysis, documentation generation, convention enforcement, or code generation — not request-path runtime reflection. It can inspect source without bootstrapping Laravel, which is useful for analyzing classes that are expensive or unsafe to autoload. It does not replace Laravel’s container/runtime reflection and will not understand container bindings, facades, macros, dynamic properties, or runtime-discovered behavior.ReflectionClass, ReflectionMethod, etc. A Laravel team could wrap it behind an internal service and expose it through an Artisan command or CI job. Feasibility is constrained by the current 5.x requirements — PHP >= 8.5 and nikic/php-parser ^5.9 — which may not match the Laravel application’s PHP version or existing static-analysis toolchain. The library also has low visible ecosystem adoption (101 stars, 0 dependents), so integration confidence must come from internal spikes and tests rather than community validation.invoke(), setAccessible(), etc.) can trigger class loading and native reflection, so the “no side effects” property is not universal. AST-only analysis may miss Laravel dynamic behavior and produce false confidence. Current releases track future PHP versions aggressively, including PHP 8.6 RC behavior, which is valuable but raises compatibility-testing requirements. There is no evident persistent cache, so full-repo scans may be slow and memory-heavy. Maintenance appears concentrated around the primary maintainer, and low dependent count increases bus-factor and upgrade-risk concerns.nikic/php-parser ^5.9 conflict with PHPStan, Rector, PHPUnit, or other tooling? Can the team accept static-analysis divergence from runtime behavior? Who owns upgrades and upstream issue triage? What is the exit plan if the package lags PHP/Laravel releases?Go\ParserReflection so application code does not depend directly on its concrete classes. Use it in an Artisan command, CI analysis job, or generator that emits cached artifacts. Keep it out of HTTP request handling and queue workers.nikic/php-parser ^5.9; Laravel applications on PHP 8.2–8.4 will likely need an older major or should defer adoption. Verify Composer resolution alongside PHPStan, Rector, PHPUnit, and any Laravel packages that preload nikic/php-parser. Test on the lowest and highest supported PHP versions in CI.vendor/ tree can be slow and memory-intensive. Use changed-file analysis, parallelism, artifact caching, and explicit file exclusions. Never invoke it per request. If results are needed at runtime, generate and cache metadata during build/deploy instead.How can I help you explore Laravel packages today?