Download the PHP package quintenmbusiness/php-ast-toolkit without Composer
On this page you can find all versions of the php package quintenmbusiness/php-ast-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quintenmbusiness/php-ast-toolkit
More information about quintenmbusiness/php-ast-toolkit
Files in quintenmbusiness/php-ast-toolkit
Package php-ast-toolkit
Short Description A powerful PHP toolkit for analyzing, modifying, and generating code using AST (Abstract Syntax Tree).
License MIT
Informations about the package php-ast-toolkit
PhpAstCodeToolkit
PhpAstCodeToolkit is a PHP library that simplifies working with Abstract Syntax Trees (AST) by providing utilities to analyze, modify, and generate PHP code. Built on top of the powerful nikic/php-parser, it offers a streamlined API for developers.
Features
- Analyze PHP files and extract class, method, and property information.
- Modify existing code structures using a clean object-oriented approach.
- Generate interfaces and classes programmatically.
- Synchronize changes between the AST and source code.
- Lightweight and easy to integrate into any PHP project.
Installation
Install the package via Composer:
Usage
Analyzing PHP Files
Use the DirectoryScanner
to analyze PHP files in a directory and extract class information.
Modifying a Class
Change the name of a class and update a method:
Generating an Interface
Create an interface from an existing class:
Copying a Class
Copy a class to a new file:
Requirements
- PHP 8.1 or higher
- nikic/php-parser (installed automatically via Composer)
Credits
This library is powered by nikic/php-parser.
License
PhpAstCodeToolkit is open-source software licensed under the MIT License.