An open API service indexing awesome lists of open source software.

https://github.com/quintenmbusiness/phpastcodegenerationhelper

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

ast code-generation development-tool generation nikic-php-parser php

Last synced: 9 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# PHP AST Code Generation Helper

[![Latest Stable Version](https://img.shields.io/packagist/v/quintenmbusiness/php-ast-code-generation-helper)](https://packagist.org/packages/quintenmbusiness/php-ast-code-generation-helper)
[![Total Downloads](https://img.shields.io/packagist/dt/quintenmbusiness/php-ast-code-generation-helper)](https://packagist.org/packages/quintenmbusiness/php-ast-code-generation-helper)
[![License](https://img.shields.io/github/license/quintenmbusiness/PhpAstCodeGenerationHelper)](https://github.com/quintenmbusiness/PhpAstCodeGenerationHelper/blob/master/LICENSE)
[![Coverage Status](https://coveralls.io/repos/github/quintenmbusiness/PhpAstCodeGenerationHelper/badge.svg)](https://coveralls.io/github/quintenmbusiness/PhpAstCodeGenerationHelper)

---

### **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**

- 🛠 **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**

Install the package via Composer:

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

For development environments:

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

---

## **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**

### Packagist Statistics
- **Total Downloads**: ![Total Downloads](https://img.shields.io/packagist/dt/quintenmbusiness/php-ast-code-generation-helper)
- **Monthly Downloads**: ![Monthly Downloads](https://img.shields.io/packagist/dm/quintenmbusiness/php-ast-code-generation-helper)

---

## **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**

If you find this package useful, consider supporting its development:
- [GitHub Sponsors](https://github.com/sponsors/quintenmbusiness)

---

## **Acknowledgments**

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