friends-of-presta / fop_console

Prestashop Module providing a set of shell/terminal commands for developers (PrestaShop 1.7.5+)
Academic Free License v3.0
84 stars 35 forks source link

DevTool : command to generate Class name, service name from a command name. #212

Open SebSept opened 2 years ago

SebSept commented 2 years ago

Because of consistency rule that will be introduced soon (#97) command class name, service and command name must adhere to the convention. It could be easy to implement a simple command that will generate them from a command name.

Example ./bin/console fop:dev:generate-names "fop:mydomain:myaction" will output .

Classname : "Mydomain\MydomainMyAction" (create it in folder xxx, with namespace zzz).
Command name : "fop:mydomain:myaction" (provided by you)
Servicename : "fop.console.mydomain.myaction.command"

Maybe this could help.

I guess it should be a hidden command (not listed in ./bin/console list fop) It should also be documented in the developper's documentation.

SebSept commented 2 years ago

Not really sure, this is needed, we'll see while folks write a new command...