# nette/php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.5 features.

Repository: https://github.com/nette/php-generator
Canonical: https://ross.abutalabs.com/products/php-generator
Homepage: https://doc.nette.org/php-generator
Language: PHP
License: NOASSERTION
License Family: other
Topics: nette, nette-framework, php-generator, php, code-generator
Last push: 2026-07-13T20:04:03+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 92, release rhythm 45, longevity 100
- inputs: {"age_days": 4556, "days_push": 51, "days_rel": 205, "gap_med": 100.0, "n_releases_24m": 7}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2259, forks 145 (observed 2026-08-28T04:06:31.669156+00:00)

## What it is
A PHP library for programmatically generating PHP code for classes, functions, enums, attributes, and complete files, with support for the latest PHP 8.x features. It can also modify existing classes and produce output compliant with PSR-12/PER coding style.

## Use cases
- generate php classes programmatically
- create php code from templates or metadata
- modify existing php classes at build time
- generate php files for scaffolding tools
- produce psr-12 compliant php code
- generate enums and attributes in php 8

## When to choose
- you need to emit valid, modern PHP code from PHP itself
- you want to manipulate or extend existing PHP classes programmatically
- you need PSR-12/PER-compliant output and support for the newest PHP syntax

## When to avoid
- you need code generation in a language other than PHP
- you only need simple string templating without AST-level structure

## Facets
- artifact type: library
- maturity: stable
- function: parser, developer-tools
- domain: developer-tools, programming-languages
- platform: php, cli
- tags: php-code-generation, nette, psr-12, metaprogramming, code-manipulation, code-generation, automation

## Member repositories
- nette/php-generator (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:31.669156+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:42:46.066268+00:00, confidence not recorded.
  - readme: https://github.com/nette/php-generator (fetched 2026-08-28T04:06:31.669156+00:00, sha 7c22117557c4)
  - homepage: https://doc.nette.org/php-generator (fetched 2026-08-29T10:23:53.364740+00:00, sha 5b79b3be8a7f)
  - site_page: https://doc.nette.org/en/contributing/documentation (fetched 2026-08-29T10:23:53.376482+00:00, sha 7d2a71a103a6)
  - site_page: https://doc.nette.org/en (fetched 2026-08-29T10:23:53.374508+00:00, sha 593c2062fa13)
  - site_page: https://nette.org/en/releases (fetched 2026-08-29T10:23:53.378666+00:00, sha aa39e1b5cbb1)
  - site_page: https://doc.nette.org (fetched 2026-08-29T10:23:53.385192+00:00, sha b052116b2a14)
  - site_page: https://nette.org/en/history (fetched 2026-08-29T10:23:53.387100+00:00, sha 286192274b00)
- Data as of 2026-08-30T08:39:29.467469+00:00.
