fix/feat: Refactor commands - #7
Merged
Merged
Conversation
Member
|
Hey, you did a good job, small things to change, Just update this as per the documentation
Just And update the MakePasswordCommand |
Member
Author
|
Ok thanks, i changed it. Maybe it is a good idea to rename MakePolicyCommand to MakeAuthorizerCommand so ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This is a PR that refactors commands to eliminate code duplication, standardize command execution patterns, and improve maintainability. Also added some commands.
Refactor
Why? There were several commands using directly the Symfony Command Class, and another using the Doppar Command Class; I migrated all Symfony to the Doppar one. To have the same way of doing commands.
I refactor also all the commands, to avoid duplicated code. To reduce the number of code lines, and to improve maintainability.
Commands are now smaller, and users could now use some of the command generic function like :
This functions include a newLine().
here a concret example of ClearConfigCommand
Before
after
I added a more complexe function :
executeWithTiming()to allow more complexe logique, example with the new MakePasswordCommandCommands added
I added 3 commands :
-
make:passwordthat allow user to generate a password in command line. Very usefull for user that want to create a user in database quickly. It is a thing that is very usefull in symfony : https://symfony.com/doc/current/security/passwords.html#reset-password-
server:start {port?} {--background} {--bg}start a server on a port, can add : --bg or --background to start it in a background.If you don't put a port, it will find an available one, starting with 8000.
-
server:stop {port?}stop a local server on a port, or stop all php servers if port isnt specifyI am open for reviews, and ready to edit this PR.
Thanks for your work