codememory/reflection
Cacheable alternative to PHP’s Reflection API. Uses a Symfony Cache adapter to store class metadata (names, methods, properties, types, attributes) for faster repeat reflection in production, with a dev mode toggle via ReflectorManager.
For Executives: "This package replaces PHP’s built-in reflection with a cached version, cutting reflection overhead by up to X% (benchmarks pending). For apps like [Product X]—where reflection powers [feature Y]—this could reduce latency by ~Y% and improve scalability without rewrites. The MIT license and Symfony integration make it low-risk, with minimal dev lift. ROI: Faster feature delivery and lower cloud costs for high-traffic endpoints."
For Engineering:
*"We’re proposing a drop-in replacement for ReflectionClass/ReflectionProperty that caches results in Symfony’s filesystem cache. Key benefits:
Reflection for ReflectorManager.For Developers: *"To use:
composer require codememory/reflection.FilesystemAdapter).new ReflectionClass(X) with $rm->getReflector(X::class).
Example:$cache = new FilesystemAdapter('reflection', 'var/cache');
$rm = new ReflectorManager($cache);
$reflector = $rm->getReflector(MyClass::class); // Cached!
Gotchas:
isDev=true) bypasses cache for debugging.How can I help you explore Laravel packages today?