rikudou/reflection-file
A PHP library that adds file-level reflection, making it easy to inspect classes, interfaces, traits, functions, and constants declared in a source file. Useful for tooling, static analysis, and package discovery without manually requiring files.
artisan scaffolding, module auto-registration — this is a candidate primitive rather than writing our own tokenizer wrapper.rikudou/class-finder). That is a maintenance-budget and supply-chain decision, not a product one.nikic/php-parser (AST, heavier, actively maintained), roave/better-reflection (full static reflection, heavier), and PHP 8's native reflection plus attributes. The PM-relevant axis is capability per unit of maintenance burden.Consider it when:
class-finder) and this is already on the dependency graph — in which case the decision is pinning and auditing, not adopting.Look elsewhere when:
nikic/php-parser or roave/better-reflection. Do not stretch a file-reflection shim into an analysis engine.composer/class-map-generator or symfony/finder cover it with real maintenance.For executives (one paragraph): This is a tiny, single-purpose PHP utility for reading information out of source files. It is free (WTFPL), has no known dependents, no stars, and has not been updated since early 2019 — meaning we would be adopting code nobody maintains. That is acceptable only as an internal, vendored helper inside developer tooling, where failure is low-impact and we can fix it ourselves. It is not a platform or architecture decision, and it should not enter any customer-facing or revenue-critical path. Recommendation: do not add it as a new dependency; if it appears transitively, pin it, audit the source (it is small), and plan to replace it with PHP 8 native reflection, nikic/php-parser, or an in-house equivalent at the next touch.
For engineering (the practical case): The value proposition is a minimal wrapper that lets you reflect over a file's contents — namespace, declared classes — without pulling in a parser. It is a building block for class discovery and codegen. The costs are equally concrete: unmaintained since 2019, no CI or release cadence to trust, an unconventional license your legal team may flag, and no upstream to escalate bugs to. If we use it, we vendor the source, add it to our owned-code list, and write our own tests around the API surface we actually call. If we need more than trivial file introspection, skip straight to nikic/php-parser or PHP 8 attributes — the extra weight buys maintenance, correctness, and a community we can lean on.
How can I help you explore Laravel packages today?