You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Spiral framework offers a brilliant development extension to streamline the creation of application services, controllers, middleware, and other classes through AST modification.
Currently, we can mark any class as prototyped with a given name using the #[Prototyped('name')] annotation as shown in the example below:
After annotating our classes, we can run the php app.php prototype:dump command to index all classes marked as prototyped, which is quite handy.
Additionally, the framework allows us to use prototyped classes directly without any need for import using Spiral\Prototype\Traits\PrototypeTrait, as demonstrated below:
However, one feature that would further enhance this functionality is the ability to list all available prototypes through a console command. It's currently a bit of a hassle not having a straightforward way to view all available prototypes at a glance. Therefore, I propose the addition of a new console command, like:
php app.php prototypes
Upon executing this command, it should return a list of all available prototypes along with their target classes in a tabular format, as exemplified below:
| Name | Target |
|------|----------------------------|
| guard| \App\Security\GuardScope |
This feature will provide a quick overview of all the prototyped classes, making it easier for developers to see what's available at a glance and perhaps aiding in debugging or refining the code structure.
The text was updated successfully, but these errors were encountered:
The Spiral framework offers a brilliant development extension to streamline the creation of application services, controllers, middleware, and other classes through AST modification.
Currently, we can mark any class as prototyped with a given name using the
#[Prototyped('name')]
annotation as shown in the example below:After annotating our classes, we can run the
php app.php prototype:dump
command to index all classes marked as prototyped, which is quite handy.Additionally, the framework allows us to use prototyped classes directly without any need for import using
Spiral\Prototype\Traits\PrototypeTrait
, as demonstrated below:With the existing setup, IDEs provide autocompletion suggestions for such classes, which is an excellent productivity booster.
However, one feature that would further enhance this functionality is the ability to list all available prototypes through a console command. It's currently a bit of a hassle not having a straightforward way to view all available prototypes at a glance. Therefore, I propose the addition of a new console command, like:
Upon executing this command, it should return a list of all available prototypes along with their target classes in a tabular format, as exemplified below:
This feature will provide a quick overview of all the prototyped classes, making it easier for developers to see what's available at a glance and perhaps aiding in debugging or refining the code structure.
The text was updated successfully, but these errors were encountered: