PHP Code Parser Lib
Parse Code Components
This library parses PHP code into logical components for inspection and automation.
Some features:
- Detect classes from files, folders, or raw strings.
- Parse PHP tokens using `token_get_all`.
- Extract class metadata (name, namespace, path).
- Retrieve class properties, methods, and functions.
- Extract function/method code or raw bodies.
- Read namespaces, use statements, and includes.
- Extract and remove comments or PHPDoc blocks.
Usage
Init:
Get Classes:
Get Class Components:
Get Class Properties:
Get Function/Method Components:
Get Namespaces/Uses/Includes:
Get Comments: