awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
nette avatar

nette/php-generator

0
View on GitHub↗
2,253 stars·147 forks·PHP·7 viewsdoc.nette.org/php-generator↗

Php Generator

Php-generator is a metaprogramming library for programmatically generating, inspecting, parsing, and manipulating PHP source code using expressive object-oriented structures. It allows developers to construct classes, interfaces, traits, enums, functions, closures, and complete files without writing raw strings.

The library features automated namespace resolution to manage fully qualified class names and use statements, preventing naming collisions in generated output. It also includes configurable formatting utilities that transform abstract syntax trees into text strings adhering to established style specifications such as standards like PSR-2, PSR-12, and PER, alongside data serialization tools for converting runtime variables into parseable code representations.

Features

  • PHP Code Generators - Builds classes, functions, namespaces, and entire source files programmatically using an object-oriented structure instead of writing raw strings.
  • Code Formatting - Converts programmatic code structures into valid text strings complying with standard coding style specifications like PSR-2, PSR-12, and PER.
  • Code Printer Formatters - Transforms abstract syntax trees into formatted text strings adhering strictly to established coding style specifications and custom rules.
  • PHP Code Formatters - Transforms programmatic structures into clean, standards-compliant PHP code strings matching established style guidelines like PSR-12.
  • Namespace Organization - Organizes classes, functions, and interfaces into structured namespaces with automated alias resolution and use statements.
  • Metaprogramming Toolkits - A tool that parses, inspects, and modifies existing PHP source code through reflection and programmatic manipulation interfaces.
  • Qualified Name Resolution - Resolves fully qualified class names and use statements automatically to prevent naming collisions in generated output.
  • Syntax Trees - Constructs a syntax tree using expressive object models so developers assemble valid code structures programmatically without writing raw strings.
  • Object-Oriented Structural Organization - Programmatically builds classes, interfaces, traits, enums, and namespaces with configurable members, types, attributes, and visibility modifiers.
  • Source Code Loaders - Inspects existing source files and running classes to load them back into the object model for dynamic modification.
  • File Assemblers - Assembles complete PHP files combining classes, functions, namespaces, and strict type declarations into ready-to-output file structures.
  • Runtime Class Modifications - Updates existing class structures by inheriting methods and properties or implementing abstract requirements dynamically.
  • Source Function Generation - Builds global functions, anonymous closures, and short arrow functions with customizable signatures, parameters, return types, and bodies.
  • Expression Escapers - Converts arbitrary runtime values and PHP expressions into safe, parseable code representations suitable for injection into generated output.
  • PHP Code Analysis - Parses existing PHP source files and classes into an object model so they can be analyzed, modified, and re-exported.
  • Source File Parsing - Loads and analyzes existing source files, classes, and functions via reflection or parsing to programmatically inspect, modify, or replicate them.
  • Language Construct Generators - Constructs modern language features including property hooks, asymmetric visibility, promoted parameters, and variadic arguments.

Star history

Star history chart for nette/php-generatorStar history chart for nette/php-generator

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Php Generator

Similar open-source projects, ranked by how many features they share with Php Generator.
  • phpdocumentor/phpdocumentorphpDocumentor avatar

    phpDocumentor/phpDocumentor

    4,332View on GitHub↗

    phpDocumentor is a PHP API documentation generator and source code analyzer that transforms PHP files and DocBlocks into structured HTML API references. It functions as a static site generator and an automatic documentation tool designed to synchronize technical documentation with code changes. The project distinguishes itself by acting as a UML diagram generator, producing class and architectural graphs via PlantUML based on source analysis. It also supports technical manual authoring, rendering hand-written guides in Markdown and ReStructuredText alongside the automatically generated API re

    PHPdocblockdocblocksgraphviz
    View on GitHub↗4,332
  • sds/overcommitsds avatar

    sds/overcommit

    4,008View on GitHub↗

    Overcommit is a Git hook manager and pre-commit validation framework designed to automate the execution of scripts and checks during various Git events. It serves as a workflow automation tool that ensures code quality and project standards are met before changes are committed or pushed to a remote repository. The system distinguishes itself through a comprehensive YAML-based configuration that allows for detailed hook behavior control, including file execution filtering, conditional skipping, and the management of hook dependencies. It provides specialized roles such as a commit message vali

    Ruby
    View on GitHub↗4,008
  • nikic/php-parsernikic avatar

    nikic/PHP-Parser

    17,437View on GitHub↗

    PHP-Parser is a tool that converts PHP source code into an abstract syntax tree for static analysis and programmatic manipulation. It functions as a parser, a code generator, and a static analysis framework. The project enables the programmatic construction of abstract syntax tree nodes through a fluent interface and provides the ability to transform these trees back into formatted source code. It includes a serializer that exports abstract syntax trees to JSON format and reconstructs them from strings. The toolset covers several capability areas, including namespace resolution, constant exp

    PHP
    View on GitHub↗17,437
  • twigphp/twigtwigphp avatar

    twigphp/Twig

    8,363View on GitHub↗

    Twig is a PHP template engine and compiled rendering library designed to separate business logic from presentation. It functions as a secure template language that generates HTML output by combining dynamic data with reusable layouts. The system emphasizes security through a focus on preventing cross-site scripting attacks via automatic output escaping and content sanitization. To ensure execution efficiency, it compiles templates into optimized PHP code and utilizes a caching mechanism to bypass parsing on subsequent requests. The engine provides comprehensive tools for template composition

    PHPphptemplate-enginetemplate-language
    View on GitHub↗8,363
See all 30 alternatives to Php Generator→

Frequently asked questions

What does nette/php-generator do?

Php-generator is a metaprogramming library for programmatically generating, inspecting, parsing, and manipulating PHP source code using expressive object-oriented structures. It allows developers to construct classes, interfaces, traits, enums, functions, closures, and complete files without writing raw strings.

What are the main features of nette/php-generator?

The main features of nette/php-generator are: PHP Code Generators, Code Formatting, Code Printer Formatters, PHP Code Formatters, Namespace Organization, Metaprogramming Toolkits, Qualified Name Resolution, Syntax Trees.

What are some open-source alternatives to nette/php-generator?

Open-source alternatives to nette/php-generator include: phpdocumentor/phpdocumentor — phpDocumentor is a PHP API documentation generator and source code analyzer that transforms PHP files and DocBlocks… sds/overcommit — Overcommit is a Git hook manager and pre-commit validation framework designed to automate the execution of scripts and… twigphp/twig — Twig is a PHP template engine and compiled rendering library designed to separate business logic from presentation. It… nikic/php-parser — PHP-Parser is a tool that converts PHP source code into an abstract syntax tree for static analysis and programmatic… ambv/black — Black is a deterministic Python code formatter and style guide enforcer. It automatically reformats source code and… google/vim-codefmt — Vim-codefmt is a plugin for the Vim text editor that automates source code formatting by integrating external…

Curated searches featuring Php Generator

Hand-picked collections where Php Generator appears.
  • Syntax parser