Download the PHP package nxu/php-nano-class-parser without Composer
On this page you can find all versions of the php package nxu/php-nano-class-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nxu/php-nano-class-parser
More information about nxu/php-nano-class-parser
Files in nxu/php-nano-class-parser
Package php-nano-class-parser
Short Description A fully opinionated, extremely minimal, and very optimistic package to help add custom code to generated PHP classes.
License MIT
Informations about the package php-nano-class-parser
🏗️ php-nano-class-parser
This is a very simple package that helps you parse some information about some PHP files.
Philosophy
The intended purpose of this package is to determine the presence and optionally the vertical position of some statements in a PHP file. This is useful in situations like programmatically adding extra boilerplate to generated files.
Provided analyses:
- Imports (
use <FQN>;
) - Class definition (
class Someting {}
) - Trait uses (
use <Trait>;
) - First function of a class (
public static function Something {}
)
My use case
I am maintaining a CMS that is based on Laravel and Filament. Part of the CMS are commands that generate PHP files (such as Laravel Models and Filament Resources). During generation, my goals are:
- Use the built-in generators
- Append some custom PHP boilerplate to it
This package helps me determine where to add custom namespace uses, member properties and member functions as crude strings.
Main features / restrictions
- Extremely mimimal
- The package only provides what I need, nothing more.
- Fully opinionated
- The package provides its functionality exactly how I need it.
- Very optimistic
- This is a very nice way of saying "I don't really care about edge cases".
How?
Install
Use
TLDR
Available analyses
License
This package is licensed under the MIT license.
All versions of php-nano-class-parser with dependencies
ext-tokenizer Version *
nikic/php-parser Version ^4.17
illuminate/collections Version >=10