matthiasnoback / php-ast-inspector
Installs: 16 451
Dependents: 0
Suggesters: 0
Security: 0
Stars: 71
Watchers: 6
Forks: 1
Open Issues: 3
Requires
- php: ^8.1
- nikic/php-parser: ^4.14
- symfony/console: ^6.1
Requires (Dev)
- phpstan/phpstan: ^1.8.2
- phpunit/phpunit: ^9.5.21
- rector/rector: ^0.14.2
- symplify/coding-standard: ^11.1
- symplify/easy-coding-standard: ^11.1
README
This package offers a command-line utility for parsing a PHP script and navigating the resulting Abstract Syntax Tree (AST), showing information about the nodes and highlighting the corresponding part of the original script.
Installation
composer require --dev matthiasnoback/php-ast-inspector
Usage
Run ast-inspect
by pointing it at a script that you want to inspect, e.g. if your script is called file.php
:
vendor/bin/ast-inspect inspect file.php
Now use the keys (a
, s
, d
, w
) to navigate the node tree. Quit using Ctrl + C
.