Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Method Modifier Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer-experience roadmap / scaffolding investments. If the roadmap includes "make:*" style generators, package bootstrappers, or upgrade automation, this package sits in the codegen category — specifically the narrow slice where you need to edit an existing method rather than emit a whole new file. Useful as a capability reference when scoping such an epic.
  • Build vs. buy vs. copy for internal tooling. The realistic decision here is rarely "depend on this"; it's "do we hand-roll AST manipulation, adopt Rector/nikic/php-parser, or lift the approach from a small reference implementation?" This package informs that trade-off with a concrete, readable example of method-level source editing. The v2.0.0 release doesn't change that framing — it's a compatibility refresh, not new capability.
  • Feasibility spikes for refactoring/codemod features. Low-cost way to prototype whether automated method injection (e.g., adding a trait method, adding an interface implementation, injecting logging) is worth productizing. Zero adoption means near-zero integration cost for a spike.
  • Prioritization of maintenance-boundary features. A package with one substantive release since May 2022 — and that release being dependency bumps only — is still a signal: any feature whose value depends on this library inherits its maintenance risk. Slight improvement in the signal (someone is still merging PRs), but nowhere near enough to change the roadmap call.
  • Platform-baseline decisions. v2.0.0's move to Symfony 6.0 quietly becomes a compatibility floor: it aligns with Laravel 9+ and excludes older stacks pinned to Symfony 5 components. If any internal tooling still runs a Laravel 8-era app, adopting this now forces a platform decision that has nothing to do with the codemod feature you actually wanted.
  • Not a customer-facing decision. There is no end-user capability unlocked here; it is infrastructure for the team's own velocity, so it should be evaluated against engineering-time savings, not revenue.

When to Consider This Package

Consider it when:

  • The need is genuinely method-scoped source transformation — surgical edits inside an existing class body — not file generation from templates.
  • The consumer is internal tooling, a one-off codemod, or a spike, where a lightly-maintained dependency is acceptable and the code can be vendored or copied outright (BSD-3-Clause permits this).
  • Your team writes PHP and would otherwise resort to regex/string splicing on source files, which is the actual alternative and is materially worse.
  • You are already on Symfony 6 components (Laravel 9+) and the v2.0.0 floor is therefore free — on older stacks, treat this as a reason to copy the source rather than require it.
  • You want a small, digestible reference implementation to learn method-level AST editing from, rather than a long-term dependency.

Look elsewhere when:

  • The work is production-critical or ships to customers — one dependency-bump release since 2022, no dependents, and a single maintainer still mean no real support path.
  • You need broad refactoring, framework upgrades, or multi-file codemods: Rector and nikic/php-parser are the mature, maintained choices and cover method-level edits as a subset.
  • Your app is on Symfony 5-era Laravel: v2.0.0's breaking upgrade makes this package unusable without a framework bump, and v1.0.1 is now two majors behind the current line.
  • You need guarantees around modern PHP/Laravel versions or PHPUnit-style regression safety for transformed code — the release adds tooling-version bumps, not coverage guarantees.
  • Your org's policy requires active maintenance, security response, or vendor accountability — a dependabot merge does not clear that bar.
  • The requirement is really "generate a class" or "generate a migration," where Laravel's own stub-based generators already suffice.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib