Add generic templates for DataResponse and JSONResponse#36355
Closed
provokateurin wants to merge 1 commit intomasterfrom
Closed
Add generic templates for DataResponse and JSONResponse#36355provokateurin wants to merge 1 commit intomasterfrom
provokateurin wants to merge 1 commit intomasterfrom
Conversation
This was referenced Jan 25, 2023
Signed-off-by: jld3103 <jld3103yt@gmail.com>
a56f235 to
9eff3c5
Compare
Merged
Contributor
|
This adds a new constraints that one cannot use setData with another type than what was used in the constructor. No idea if this is a problem or not. |
| /** | ||
| * response data | ||
| * @var array|object | ||
| * @var T |
Member
There was a problem hiding this comment.
this weakens the type. before it was an array or object. now it can be anything
Member
Author
|
Waiting on a solution for #36513 before continuing since this change might not be needed after all. |
Member
Author
|
I just realized this isn't possible, since psalm will complain about missing template types in every place that isn't updated. |
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
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.
Summary
Add templates to indicate generic type. Not required, but very useful for OpenAPI.
Checklist