gossi/php-code-generator
A lightweight PHP library for generating PHP code programmatically. Build classes, methods, properties, namespaces, and docblocks through a fluent API, then render valid source files for scaffolding, code generation, and automation workflows.
profile + enableFormatting options signal a move toward standardized, tool-integrated output. If your roadmap includes “generated code must pass CI linting/formatting without manual touch-ups,” this release makes that a candidate path — but the feature is explicitly experimental, so it should be treated as a spike, not a committed platform bet yet.gossi/php-code-formatter) materially affects whether generated code is reviewable in PRs. If generated artifacts are committed, formatting quality becomes a product-visible concern; if generated at build time, this is lower priority.PhpFunction deprecation (see #35) plus continued pre-1.0 releases means any decision to adopt should include a migration-cost line item on the roadmap — a product decision, not just an engineering one.Consider adopting when:
enableFormatting rather than depend on it in a critical path.Look elsewhere when:
PhpFunction deprecation and experimental formatter are clear signals of churn ahead.PhpFunction and you cannot absorb a migration.enableFormatting is labeled “very experimental,” so treat it as prototype-grade.Immediate action for current/future adopters: pin to an exact version, track issue #35 for the PhpFunction migration path, and avoid committing to the formatter’s output contract until it exits experimental status.
To executives: This is a low-cost, open-source Laravel package that can reduce repetitive coding by generating boilerplate programmatically. The latest beta adds configurable output formatting (still experimental) and fixes real correctness bugs, indicating active maintenance. Recommendation: fund a short, timeboxed evaluation rather than a broad rollout — the package is pre-1.0, so the primary risk is rework from API changes, not licensing cost.
To engineering: Adopt behind a pinned version in a spike branch. Two things to plan for: (1) PhpFunction is now deprecated (issue #35) — inventory any current usage and budget a migration; (2) enableFormatting depends on gossi/php-code-formatter and is explicitly experimental — do not wire it into CI as a hard gate yet. The interface-FQCN and trait-ordering fixes improve generated-output correctness, which reduces post-generation cleanup. Validate output against your own fixtures before trusting it in a shared generator.
How can I help you explore Laravel packages today?