PHPackages                             quintenmbusiness/php-ast-code-generation-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. quintenmbusiness/php-ast-code-generation-helper

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

quintenmbusiness/php-ast-code-generation-helper
===============================================

A PHP library for generating Abstract Syntax Tree (AST) nodes programmatically, simplifying code generation with nikic/php-parser.

1.0.2(1y ago)276MITPHPPHP &gt;=8.2 &lt; 8.4

Since Nov 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/quintenmbusiness/PhpAstCodeGenerationHelper)[ Packagist](https://packagist.org/packages/quintenmbusiness/php-ast-code-generation-helper)[ RSS](/packages/quintenmbusiness-php-ast-code-generation-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (10)Used By (0)

PHP AST Code Generation Helper
==============================

[](#php-ast-code-generation-helper)

[![Latest Stable Version](https://camo.githubusercontent.com/303ff7c8a2e698e5ed9168bf9cf5a680354fa48ecf6aa0ebdae91e7c02881cf1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)](https://packagist.org/packages/quintenmbusiness/php-ast-code-generation-helper)
[![Total Downloads](https://camo.githubusercontent.com/01ab9b75628ceaa14958b7b2a8321d5cd23b3f6de9bad8b4ec6567896c269ed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)](https://packagist.org/packages/quintenmbusiness/php-ast-code-generation-helper)
[![License](https://camo.githubusercontent.com/1eaa33f2ed2d18c080ec9ab62f8f82b65b9006d488810bf12a1ec4d3507a800d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7175696e74656e6d627573696e6573732f506870417374436f646547656e65726174696f6e48656c706572)](https://github.com/quintenmbusiness/PhpAstCodeGenerationHelper/blob/master/LICENSE)
[![Coverage Status](https://camo.githubusercontent.com/0a1170828345c75a391a3b09c9f7c293ce5b7e074e0b2ac3962089b80317eaf7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7175696e74656e6d627573696e6573732f506870417374436f646547656e65726174696f6e48656c7065722f62616467652e737667)](https://coveralls.io/github/quintenmbusiness/PhpAstCodeGenerationHelper)

---

### **Introduction**

[](#introduction)

`php-ast-code-generation-helper` is a utility package designed to simplify working with the abstract syntax trees (ASTs) generated by [nikic/php-parser](https://github.com/nikic/PHP-Parser). This package provides helper functions to streamline code generation, allowing developers to create PHP code programmatically with ease.

Whether you're building a code generation tool, refactoring engine, or educational AST visualization tool, this package has you covered!

---

**Features**
------------

[](#features)

- 🛠 **Simplified AST Node Creation**: Generate PHP classes, methods, properties, and more using intuitive helper methods.
- 🚀 **Nikic PHP-Parser Integration**: Seamlessly integrates with the AST generated by `nikic/php-parser`.
- 📜 **Readable and Maintainable Code**: Focus on what to generate, not how to build the AST nodes.
- 🧩 **Customizable**: Extend and customize the helpers to suit your project requirements.

---

**Installation**
----------------

[](#installation)

Install the package via Composer:

```
composer require quintenmbusiness/php-ast-code-generation-helper
```

For development environments:

```
composer require --dev quintenmbusiness/php-ast-code-generation-helper
```

---

**Usage**
---------

[](#usage)

For complete details and advanced examples, check out the [Wiki](https://github.com/quintenmbusiness/PhpAstCodeGenerationHelper/wiki/PHP-AST-Code-Generation-Helper-%E2%80%90-Wiki-Homepage).

---

**Stats**
---------

[](#stats)

### Packagist Statistics

[](#packagist-statistics)

- **Total Downloads**: [![Total Downloads](https://camo.githubusercontent.com/01ab9b75628ceaa14958b7b2a8321d5cd23b3f6de9bad8b4ec6567896c269ed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)](https://camo.githubusercontent.com/01ab9b75628ceaa14958b7b2a8321d5cd23b3f6de9bad8b4ec6567896c269ed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)
- **Monthly Downloads**: [![Monthly Downloads](https://camo.githubusercontent.com/39f5ab784ae95a192d1f5aa382a397aba5a2d5130365cdad1d282b8b19ba2efe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)](https://camo.githubusercontent.com/39f5ab784ae95a192d1f5aa382a397aba5a2d5130365cdad1d282b8b19ba2efe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7175696e74656e6d627573696e6573732f7068702d6173742d636f64652d67656e65726174696f6e2d68656c706572)

---

**Contributing**
----------------

[](#contributing)

We welcome contributions! Please submit a pull request or open an issue for any bugs or features you'd like to see.

1. Fork the repository.
2. Create your feature branch: `git checkout -b feature/your-feature`.
3. Commit your changes: `git commit -am 'Add new feature'`.
4. Push to the branch: `git push origin feature/your-feature`.
5. Open a pull request.

---

**Support**
-----------

[](#support)

If you find this package useful, consider supporting its development:

- [GitHub Sponsors](https://github.com/sponsors/quintenmbusiness)

---

**Acknowledgments**
-------------------

[](#acknowledgments)

- Thanks to [nikic/php-parser](https://github.com/nikic/PHP-Parser) for the excellent AST parsing library.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance42

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

510d ago

Major Versions

v0.1.0 → 1.02024-12-06

PHP version history (2 changes)v0.1.0PHP &gt;=8.1

1.0.2PHP &gt;=8.2 &lt; 8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b028522208a993b8bc3838a1910a4008453d9fe6524654d1dc6460df4196cbe?d=identicon)[quintenmbusiness](/maintainers/quintenmbusiness)

---

Top Contributors

[![quintenmbusiness](https://avatars.githubusercontent.com/u/189560517?v=4)](https://github.com/quintenmbusiness "quintenmbusiness (12 commits)")

---

Tags

astcode-generationdevelopment-toolgenerationnikic-php-parserphpastcode-generationphp-parsercode generation toolphp code generatorast helper

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/quintenmbusiness-php-ast-code-generation-helper/health.svg)

```
[![Health](https://phpackages.com/badges/quintenmbusiness-php-ast-code-generation-helper/health.svg)](https://phpackages.com/packages/quintenmbusiness-php-ast-code-generation-helper)
```

###  Alternatives

[ajthinking/archetype

Programmatically edit PHP and Laravel files.

2723.4M12](/packages/ajthinking-archetype)[jakubledl/dissect

Lexing and parsing in pure PHP

2244.6M11](/packages/jakubledl-dissect)[palantirnet/drupal-rector

Instant fixes for your Drupal code by using Rector.

1544.2M20](/packages/palantirnet-drupal-rector)[atanamo/php-codeshift

A PHP code transformation toolkit based on 'PHP-Parser'

32158.4k1](/packages/atanamo-php-codeshift)[tmilos/scim-filter-parser

System for Cross-domain Identity Management SCIM AST filter parser PHP library

111.7M6](/packages/tmilos-scim-filter-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
