-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Improve TypeValidator to handle array of types #31351
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
Merged
fabpot
merged 1 commit into
symfony:4.4
from
jschaedl:validator-type_constraint_with_multiple_types
Jun 4, 2019
Merged
[Validator] Improve TypeValidator to handle array of types #31351
fabpot
merged 1 commit into
symfony:4.4
from
jschaedl:validator-type_constraint_with_multiple_types
Jun 4, 2019
Conversation
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
7a71b3e
to
0e78ee5
Compare
OskarStark
approved these changes
May 1, 2019
xabbuh
requested changes
May 4, 2019
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.
The change should also be documented in the changelog file of the Validator component.
done |
xabbuh
approved these changes
May 4, 2019
925c45d
to
6f949d8
Compare
Simperfit
approved these changes
May 12, 2019
Travis failure is not related. |
6f949d8
to
c8b4aac
Compare
628acfd
to
b5b61d3
Compare
b5b61d3
to
3fb7b32
Compare
3fb7b32
to
c8100f3
Compare
fabpot
approved these changes
Jun 4, 2019
Thank you @jschaedl. |
fabpot
added a commit
that referenced
this pull request
Jun 4, 2019
…ypes (jschaedl) This PR was merged into the 4.4 branch. Discussion ---------- [Validator] Improve TypeValidator to handle array of types | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31330 | License | MIT | Doc PR | tbd. The `@Type` constraint is now able to handle multiple types: ```php /** * @var string|array * @Assert\Type(type={"string", "array"}) */ private $name; ``` and will pass when `$name` is either of type `string` or `array`. Commits ------- c8100f3 [Validator] Improve TypeValidator to handle array of types
This was referenced Nov 12, 2019
Merged
Merged
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.
The
@Type
constraint is now able to handle multiple types:and will pass when
$name
is either of typestring
orarray
.