-
Notifications
You must be signed in to change notification settings - Fork 76
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
Singleton class for SSN #12
Comments
Please send a PR |
Will work on it. Just to show you the problem:
As you can see, I have to instantiate this class for each validation. |
Closed
The generate method of What is the goal of this method? |
To generate a SSN, based on state. |
But it is not used for validation, is it? If not, are you OK to make it static too? |
Closed for #34. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The SSN validator is special. We have to instantiate it before use it for validation.
I think is for avoid code generation (
generate('CA')
) on each validation?In this case, could we think about use it as a singleton class?
See here (FR): http://fr.wikipedia.org/wiki/Singleton_%28patron_de_conception%29#PHP_5
I suggest it because with this code design, I will have to instantiate it on each validation with my Symfony Validator wrapping.
Could work on it. This should be on a next major release.
The text was updated successfully, but these errors were encountered: