leovie/php-method-modifier
A small PHP utility for programmatically modifying method modifiers, making it easy to adjust method visibility and related characteristics at runtime. Useful for metaprogramming, testing, and code-generation workflows.
Consider it when:
Look elsewhere when:
nikic/php-parser are the mature, maintained choices and cover method-level edits as a subset.For executives: This is a small, free developer-productivity utility, not a customer-facing product. It shipped its first update in a long time, but that update is a dependency refresh with a breaking framework requirement — not evidence of a supported product. My recommendation is unchanged: don't add it as a dependency. Its value is as a cheap reference for a capability we may want — automated code modification in our own tooling — and evaluating it costs engineering hours, not budget. If we pursue codemod or scaffolding features, we should budget them as internal tooling on a maintained foundation (Rector / php-parser), not build on this.
For engineering: BSD-3-licensed, method-level PHP source modification. v2.0.0 upgrades to Symfony 6.0 and bumps infection/infection (dev-only) — that is the entire changelog. It's a major version because of the Symfony floor, not because of API or feature work, so it raises the package's platform requirement and drops older Laravel stacks without adding anything you can use. Still zero dependents, still one maintainer. The honest recommendation stands: read it for the method-editing approach, then implement against nikic/php-parser directly or adopt Rector if the scope is broader than one method. If we do prototype with it, pin v2.0.0 only if we're on Symfony 6 / Laravel 9+, vendor the source, and wrap it behind our own interface so replacement is a one-file change. Any proposal that makes a shipped feature depend on it should still be challenged on maintenance grounds before it reaches the roadmap.
How can I help you explore Laravel packages today?