ComposesRequestContent->toString() and immutable request content#76
Open
sanderdlm wants to merge 9 commits into
Open
ComposesRequestContent->toString() and immutable request content#76sanderdlm wants to merge 9 commits into
sanderdlm wants to merge 9 commits into
Conversation
added 7 commits
March 27, 2023 17:19
Passing a string to any Request is deprecated in 4.x
The old method name was confusing in the context of a request already have content, which ended up looking like: $request->getContent()->getContent(); toString better illustrates what this method does, which is return a string representation of the request content.
This commit removes the setContent setter from the AbstractRequest class. The only way to set the content of a request is now through the constructor. Once the content for a request is defined, it cannot be changed. If new content has to be sent, a new request should be made.
Author
|
It doesn't really make sense to me to have a setter for What do you think? |
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.
Branch started from #74.
2 API improvements with a BC break:
AbstractRequest->setContentis removed, making the content of a request immutable. Content can only be defined when creating the request, through the constructor. The script filename was already like this, and having both of them immutable results in a more resilient request object.ComposesRequestContent->getContentrenamed totoString, see:toStringbetter illustrates what this method does, which is return a string representation of the request content.