roave/better-reflection
Enhanced PHP reflection for static analysis: reflect classes without loading them, from PHP code strings or closures, extract AST from functions/methods, and read type declarations and docblocks. Feature-rich but slower than native reflection.
Adopt if:
Look elsewhere if:
Reflection (this package is ~10–100x slower).*"Better Reflection is a force multiplier for our [static analysis/code tooling] initiative. It lets us:
ROI: Faster tool development, higher-quality static analysis, and a competitive edge in [IDE/plugins/security tools]. Budget: ~$0 (open-source) + minor dev time for integration."*
*"Better Reflection solves a critical gap in PHP’s reflection ecosystem:
Reflection in most cases (90%+ API compatibility).findReflectionsOnLine().Trade-offs:
Action: Add to composer.json and replace ReflectionClass with BetterReflection in [Tool X]. We’ll prototype with [Use Case Y] first."*
How can I help you explore Laravel packages today?