leovie/php-param-generator
A lightweight PHP parameter generator for building parameter definitions or argument lists from concise configuration. Useful for keeping request, method, and service parameters consistent across Laravel and plain PHP projects.
Architecture fit. leovie/php-param-generator is a build-time / code-generation utility, not a runtime service. For a Laravel or general PHP codebase its correct architectural slot is require-dev, invoked from an Artisan command, a codegen script, or a test factory helper — never on a request path. That placement is what makes it a low-blast-radius decision: the artifact it produces is ordinary, checked-in PHP that we own outright, so the package is a tooling dependency with a one-file exit cost, not a framework-level commitment. For a TPM this is the key framing: the question is not "do we adopt this into the architecture" but "does generating these classes beat hand-maintaining them," and the answer is reversible.
Integration feasibility. Feasible for a small team already PHP/Laravel-native and comfortable with Composer and a build step. It is framework-agnostic with no service provider, config publish, or facade, so integration is a Composer entry plus a small internal wrapper. The real feasibility gates are (a) whether we actually have a repeated, declaratively describable shape worth generating — near-identical DTOs, request/query parameter objects, config/form schema classes, or test fixtures maintained by hand in more than one place — and (b) whether we can commit generated output and diff it in CI, so regeneration is reviewable. Absent both, there is no case.
Technical risk.
Net: this is a low-severity, contained bet. The TPM action is to bound it explicitly (dev-only, generated output in-repo, thin wrapper) and record the exit cost — roughly a day of engineering to regenerate once and drop the dependency.
Key questions.
^2.1.1 and gate on output diffs, or float.Stack fit. Composer package, no Laravel wiring. It slots alongside, not instead of, existing test factories and Faker-based definitions — it augments fixture authoring rather than replacing it. Natural home is a dev-tooling / scaffolding initiative ("reduce hand-maintained boilerplate") with a measurable success metric: count of hand-written near-duplicate classes retired. It has no fit on any production data path, and should be rejected from anything that ships to a runtime.
Migration path.
require-dev with an explicit constraint (^2.1.1) rather than a floating range, given the output-stability ambiguity.Compatibility. The patch introduces no framework-level compatibility surface. The checks that matter are PHP version against the package constraint plus our CI matrix, and reflection support for whatever language features our codebase standardizes on. Validate against the actual runtime before broad adoption; small packages typically test a narrow matrix, and this one has had no release since 2022.
Sequencing. Bump to ^2.1.1 on a branch → run the full suite → diff generated output against the previous version for any tests already using the package → merge only if the diff is empty or explainable → then continue any planned broader adoption. Treat the 2.1.0→2.1.1 output diff as the acceptance criterion, not the changelog. If output differs, investigate before merge: the prior behavior was order-dependent and our expectations may encode a bug.
Maintenance. Near-zero steady state: dev-only, no config, no migrations, no scheduled work, no runtime config surface. The recurring obligation is version pinning plus a dependency-review slot — and this release proves that slot is low-effort but non-trivial, since a one-line changelog required inference to interpret. Budget the recurring review rather than assuming release notes will be self-explanatory.
Support. Single maintainer, escalate-through-GitHub-issues. Assume self-service: our own wrapper, our own fixture expectations, and a documented fallback to hand-written parameters if the project stalls. Mitigation is structural — keep the wrapper thin, keep generated output in-repo, and ensure no test suite becomes unbuildable without the package.
Scaling. Scales with test count, not traffic. Generation is reflection-heavy and runs at test/build time, so the practical scaling concern is CI wall-clock on large suites — measure before rolling out across a large codebase. There are no production scaling characteristics to model.
Failure modes. (1) Generated values shift shape after a patch bump, producing failing or — worse — silently weakened assertions. (2) Reflection gaps on newer PHP language features produce generation errors for specific signatures. (3) Package abandonment leaves suites pinned to an unmaintained dev dependency. (4) Over-broad adoption degrades test readability because generated parameters obscure intent. All four are contained to CI and build tooling; none can reach production, which is precisely why the blast radius stays defensible.
Ramp-up. Low technically — an hour to read the API and a spike to validate, for engineers already fluent in PHPUnit/Pest. The genuine cost is cultural: teams must agree on when generated parameters are appropriate versus when explicit fixtures carry intent better. Write a one-paragraph convention (new tests only; no test asserts on a specific generated value; snapshot the shape if asserting on structure) and the onboarding cost collapses to near zero. Communicate the decision to stakeholders as a bounded build-time tool with a ~1-day exit cost, and flag only maintenance/bus-factor as the live risk — not lock-in.
How can I help you explore Laravel packages today?