Fixed validation_groups when option is a Closure #93
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.
Hi,
I'm having an issue using this bundle on my project when having a
validation_groups
option which is a Closure.I have a
companyName
property on my data class which can be null when usingperson
validation group and cannot be blank when we are using thecompany
validation group following:Here is the closure I use to define the
validation_groups
option in my form type:Here is the output with the current code:
My form does not validate with the current code as it does not know the validation groups as it retrieves the class names instead.
Using my fix, I got a correct output and my form now validates:
Note: I've also fixed the
satooshi/php-coveralls
dependency to retrieve the latest 1.0.x compatible version as 2.0.x will be available for PHP >= 5.5 only and it breaks the the composer installation (using --dev) actually.Thank you for your quick answer.