o0h / php-ast-check-diff

This is an action to check modifications in PHP scripts based on Abstract Syntax Tree (AST).
MIT License
3 stars 1 forks source link

PHP AST Check Diff Tool

phpunit codecov

Overview

The PHP AST Check Diff Tool is a powerful tool tailored for enhancing and refactoring PHP applications. This tool differentiates itself by analyzing PHP code through its Abstract Syntax Tree (AST), enabling more in-depth and meaningful code comparisons.

Key Features

User Benefits

Appendix(thanks!)

Inspiration: The development of this tool was inspired by articles from :

Usage

To use the PHP AST Check Diff Tool, follow these steps:

  1. Installation:
    • Run composer require --dev o0h/ast-check-diff to install the tool.
  2. Execution:
    • Execute vendor/bin/ast-check-diff check to perform a comparison and output a Markdown document to standard output.
    • The --head and --base options can be passed via CLI to specify the source and destination of the comparison. Branch names, tags, or commit hashes can be used for this purpose.
  3. Integration with GitHub Actions:

examples:

Due to the above points, it is recommended to use this tool in isolated environments such as containers or on Continuous Integration (CI) platforms, rather than directly requiring it in your project.