-
Notifications
You must be signed in to change notification settings - Fork 356
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
Add constraint factory #143
Add constraint factory #143
Conversation
@bighappyface ping |
+1 @alecsammon would you mind giving this a review? |
* @return ConstraintInterface|ObjectConstraint | ||
* @throws InvalidArgumentException if is not possible create the constraint instance. | ||
*/ | ||
public function factory($constraintName) |
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.
I think this might be clearer if called getConstraintValidator
or something similar. The class is a factory, this is a getter/builder.
Hi @Maks3w. Looks like a good PR, is essential that custom validation formats are supported by this library. I've put quite a few comments on, most of these are to do with my personal style, so happy if you disagree and say no! Thanks for you patience with this PR. |
Done |
Hi @Maks3w - great - thank you... @bighappyface - one question for you - if the Otherwise I'm happy - once answered then it's ready to merge +1 |
About class name rules I have two:
|
Travis-CI error is not related to this changes. |
@Maks3w would you please rebase this on master for the latest? |
This factory can be injected and allow extend built-in constraint types with custom ones.
@bighappyface rebased and squashed |
* @param int $checkMode | ||
* @param UriRetriever $uriRetriever | ||
* @param Factory $factory |
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.
Missing |null
This factory can be injected and allow extend built-in constraint types with custom ones.
This factory allows extend the constraint system with custom ones.
Example:
This especially usefull when you need extend
FormatConstraint
for to validate custom formats.