-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Validator service #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validator service #567
Conversation
src/AppBundle/Utils/Validator.php
Outdated
|
||
class Validator | ||
{ | ||
public function username($username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the name could be: usernameValidation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateUsername
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finding the "right" name has always been the hardest part in software design 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elkuku, You're right, but a method name in most cases should be beginning with a verb. :)
This is not a command console but a console command
# Conflicts: # app/config/services.yml
This has been updated and corresponding unit tests have been added. |
This will move the validator methods in the console commands to a service.
Currently there is a bug caused by the fact that the
delete-user
command uses a different method to validate the username than theadd-user
command.So you can actually add a user but you can't remove the user ...
Later in 3.3 this can be nicely injected in the constructordone 😉