nette/php-generator
Nette PHP Generator lets you build PHP classes, interfaces, traits, enums, methods and complete files programmatically, with clean pretty-printing, full modern PHP support and a fluent API. Ideal for scaffolding, ORMs and code generators.
ClassType::from() and fromCode() preserve typed class constant types (PHP 8.3) means we can safely parse, transform, and re-emit existing classes without silently degrading their type declarations — a prerequisite for any "modernize legacy code" or AST-based refactoring roadmap item.fromCode(), so parsing is no longer lossy for that syntax.Executives: "This package automates repetitive PHP code generation, slashing development time and costs while ensuring compliance with modern standards. The latest release adds PHP 8.6 support and fixes type-safety on parsed class constants — evidence of active maintenance that keeps us ahead of PHP version upgrades instead of paying for them ourselves. Strong community adoption plus a track record of shipping support for each new PHP release makes this a low-risk, high-leverage dependency."
Engineering: "We get a typed, validated API for emitting PHP instead of string-templating code. v4.2.3 keeps us current with PHP 8.6 and fixes a real correctness bug: ClassType::from() / fromCode() now preserve the declared types on typed class constants (PHP 8.3), so parse-transform-emit pipelines are no longer lossy. Minor version bump, no breaking changes — safe to take now."
How can I help you explore Laravel packages today?