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 2024-12-15 00:54 UTC

README

Latest Stable Version
Total Downloads
License
Coverage Status

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. 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:

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

For development environments:

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

Usage

For complete details and advanced examples, check out the Wiki.

Stats

Packagist Statistics

  • Total Downloads: Total Downloads
  • Monthly Downloads: Monthly Downloads

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:

Acknowledgments